summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README6
-rw-r--r--arch/arm/boards/freescale-mx51-pdk/board.c2
-rw-r--r--arch/arm/boards/karo-tx51/tx51.c2
-rw-r--r--arch/arm/boards/tny-a926x/init.c38
-rw-r--r--arch/arm/configs/tny_a9260_defconfig2
-rw-r--r--arch/arm/configs/tny_a9263_defconfig2
-rw-r--r--arch/arm/configs/tny_a9g20_defconfig2
-rw-r--r--arch/arm/mach-at91/Kconfig10
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c13
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c19
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c13
-rw-r--r--commands/echo.c6
-rw-r--r--commands/i2c.c2
-rw-r--r--common/complete.c2
-rw-r--r--common/hush.c6
-rw-r--r--common/memory.c2
-rw-r--r--common/uimage.c6
-rw-r--r--drivers/mfd/mc13xxx.c4
-rw-r--r--net/dns.c11
22 files changed, 68 insertions, 102 deletions
diff --git a/Makefile b/Makefile
index 44b7dbd51..bcaae0ab2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
VERSION = 2012
-PATCHLEVEL = 04
+PATCHLEVEL = 05
SUBLEVEL = 0
EXTRAVERSION =
NAME = Amissive Actinocutious Kiwi
diff --git a/README b/README
index 5662a1cbe..c875b7d3c 100644
--- a/README
+++ b/README
@@ -56,7 +56,7 @@ Features
'eth0.ip=192.168.0.7' or 'echo $eth0.ip'
- initcalls
- hooks in the startup process can be archieved with *_initcall() directives
+ hooks in the startup process can be achieved with *_initcall() directives
in each file.
- getopt
@@ -95,7 +95,7 @@ This command starts a menu box and lets you select all the different
options available for your architecture. Once the configuration was
finished (you can simulate this by using the standard demo config file
with 'make sandbox_defconfig'), there is a .config file in the toplevel
-directory of the sourcode.
+directory of the source code.
Once barebox is configured, we can start the compilation
@@ -106,7 +106,7 @@ If everything goes well, the result is a file called barebox:
# ls -l barebox
-rwxr-xr-x 1 rsc ptx 114073 Jun 26 22:34 barebox
-Barebox usually needs an environment for storing the configuation data.
+Barebox usually needs an environment for storing the configuration data.
You can generate an environment using the example environment contained
in board/sandbox/env:
diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
index 937fcfa3a..74b32a99a 100644
--- a/arch/arm/boards/freescale-mx51-pdk/board.c
+++ b/arch/arm/boards/freescale-mx51-pdk/board.c
@@ -66,7 +66,7 @@ static iomux_v3_cfg_t f3s_pads[] = {
MX51_PAD_NANDF_D11__FEC_RX_DV,
MX51_PAD_NANDF_D9__FEC_RDATA0,
MX51_PAD_NANDF_D8__FEC_TDATA0,
- MX51_PAD_CSPI1_SS0__GPIO4_24,
+ MX51_PAD_CSPI1_SS0__ECSPI1_SS0,
MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
diff --git a/arch/arm/boards/karo-tx51/tx51.c b/arch/arm/boards/karo-tx51/tx51.c
index 38aefed05..096683a1a 100644
--- a/arch/arm/boards/karo-tx51/tx51.c
+++ b/arch/arm/boards/karo-tx51/tx51.c
@@ -210,7 +210,7 @@ static inline void tx51_fec_init(void)
gpio_set_value(TX51_FEC_PHY_PWR, 1);
/*
- * Wait some time to let the phy activate the internal regulator
+ * Wait some time to let the phy activate the internal regulator
*/
mdelay(10);
diff --git a/arch/arm/boards/tny-a926x/init.c b/arch/arm/boards/tny-a926x/init.c
index 79fc40fee..2cb7da7cf 100644
--- a/arch/arm/boards/tny-a926x/init.c
+++ b/arch/arm/boards/tny-a926x/init.c
@@ -121,42 +121,10 @@ static struct at91_ether_platform_data macb_pdata = {
.phy_addr = 0,
};
-static void tny_a9260_phy_reset(void)
-{
- unsigned long rstc;
- struct clk *clk = clk_get(NULL, "macb_clk");
-
- clk_enable(clk);
-
- at91_set_gpio_input(AT91_PIN_PA14, 0);
- at91_set_gpio_input(AT91_PIN_PA15, 0);
- at91_set_gpio_input(AT91_PIN_PA17, 0);
- at91_set_gpio_input(AT91_PIN_PA25, 0);
- at91_set_gpio_input(AT91_PIN_PA26, 0);
- at91_set_gpio_input(AT91_PIN_PA28, 0);
-
- rstc = at91_sys_read(AT91_RSTC_MR) & AT91_RSTC_ERSTL;
-
- /* Need to reset PHY -> 500ms reset */
- at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
- (AT91_RSTC_ERSTL & (0x0d << 8)) |
- AT91_RSTC_URSTEN);
-
- at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
-
- /* Wait for end hardware reset */
- while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
-
- /* Restore NRST value */
- at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
- (rstc) |
- AT91_RSTC_URSTEN);
-}
-
static void __init ek_add_device_macb(void)
{
- tny_a9260_phy_reset();
- at91_add_device_eth(0, &macb_pdata);
+ if (IS_ENABLED(CONFIG_CALAO_MOB_TNY_MD2))
+ at91_add_device_eth(0, &macb_pdata);
}
#else
static void __init ek_add_device_macb(void) {}
@@ -240,6 +208,8 @@ device_initcall(tny_a9260_devices_init);
static int tny_a9260_console_init(void)
{
at91_register_uart(0, 0);
+ if (IS_ENABLED(CONFIG_CALAO_MOB_TNY_MD2))
+ at91_register_uart(2, ATMEL_UART_CTS | ATMEL_UART_RTS);
return 0;
}
console_initcall(tny_a9260_console_init);
diff --git a/arch/arm/configs/tny_a9260_defconfig b/arch/arm/configs/tny_a9260_defconfig
index adbd92d1b..83293fb67 100644
--- a/arch/arm/configs/tny_a9260_defconfig
+++ b/arch/arm/configs/tny_a9260_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARCH_AT91SAM9260=y
CONFIG_MACH_TNY_A9260=y
+CONFIG_CALAO_MOB_TNY_MD2=y
CONFIG_AEABI=y
# CONFIG_CMD_ARM_CPUINFO is not set
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_FLASH=y
diff --git a/arch/arm/configs/tny_a9263_defconfig b/arch/arm/configs/tny_a9263_defconfig
index 0e4ef7653..dd68ba4d6 100644
--- a/arch/arm/configs/tny_a9263_defconfig
+++ b/arch/arm/configs/tny_a9263_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARCH_AT91SAM9263=y
CONFIG_MACH_TNY_A9263=y
+CONFIG_CALAO_MOB_TNY_MD2=y
CONFIG_AEABI=y
# CONFIG_CMD_ARM_CPUINFO is not set
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_FLASH=y
diff --git a/arch/arm/configs/tny_a9g20_defconfig b/arch/arm/configs/tny_a9g20_defconfig
index d1948e424..62250cb5a 100644
--- a/arch/arm/configs/tny_a9g20_defconfig
+++ b/arch/arm/configs/tny_a9g20_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARCH_AT91SAM9G20=y
CONFIG_MACH_TNY_A9G20=y
+CONFIG_CALAO_MOB_TNY_MD2=y
CONFIG_AEABI=y
# CONFIG_CMD_ARM_CPUINFO is not set
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_FLASH=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 989d3d82e..1bec3e5d0 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -104,6 +104,9 @@ config ARCH_BAREBOX_MAX_BARE_INIT_SIZE
config SUPPORT_CALAO_DAB_MMX
bool
+config SUPPORT_CALAO_MOB_TNY_MD2
+ bool
+
# ----------------------------------------------------------
if ARCH_AT91RM9200
@@ -138,6 +141,7 @@ config MACH_AT91SAM9260EK
config MACH_TNY_A9260
bool "CALAO TNY-A9260"
+ select SUPPORT_CALAO_MOB_TNY_MD2
help
Select this if you are using a Calao Systems TNY-A9260.
<http://www.calao-systems.com>
@@ -214,6 +218,7 @@ config MACH_AT91SAM9G20EK
that embeds only one SD/MMC slot.
config MACH_TNY_A9G20
+ select SUPPORT_CALAO_MOB_TNY_MD2
bool "CALAO TNY-A9G20"
help
Select this if you are using a Calao Systems TNY-A9G20.
@@ -264,6 +269,7 @@ config MACH_PM9263
config MACH_TNY_A9263
bool "CALAO TNY-A9263"
+ select SUPPORT_CALAO_MOB_TNY_MD2
help
Select this if you are using a Calao Systems TNY-A9263.
<http://www.calao-systems.com>
@@ -362,4 +368,8 @@ config CALAO_DAB_MMX
bool "DAB MMX Daughter Board support"
depends on SUPPORT_CALAO_DAB_MMX
+config CALAO_MOB_TNY_MD2
+ bool "MOB TNY MD2 Motherboard Daughter Board support"
+ depends on SUPPORT_CALAO_MOB_TNY_MD2
+
endif
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 9eb27f05b..a165cc945 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -273,27 +273,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
case 0: /* DBGU */
configure_dbgu_pins();
start = AT91_BASE_SYS + AT91_DBGU;
- id = 0;
break;
- case AT91RM9200_ID_US0:
+ case 1:
configure_usart0_pins(pins);
start = AT91RM9200_BASE_US0;
- id = 1;
break;
- case AT91RM9200_ID_US1:
+ case 2:
configure_usart1_pins(pins);
start = AT91RM9200_BASE_US1;
- id = 2;
break;
- case AT91RM9200_ID_US2:
+ case 3:
configure_usart2_pins(pins);
start = AT91RM9200_BASE_US2;
- id = 3;
break;
- case AT91RM9200_ID_US3:
+ case 4:
configure_usart3_pins(pins);
start = AT91RM9200_BASE_US3;
- id = 4;
break;
default:
return NULL;
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index cce99adc9..33f070a91 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -290,37 +290,30 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
case 0: /* DBGU */
configure_dbgu_pins();
start = AT91_BASE_SYS + AT91_DBGU;
- id = 0;
break;
- case AT91SAM9260_ID_US0:
+ case 1:
configure_usart0_pins(pins);
start = AT91SAM9260_BASE_US0;
- id = 1;
break;
- case AT91SAM9260_ID_US1:
+ case 2:
configure_usart1_pins(pins);
start = AT91SAM9260_BASE_US1;
- id = 2;
break;
- case AT91SAM9260_ID_US2:
+ case 3:
configure_usart2_pins(pins);
start = AT91SAM9260_BASE_US2;
- id = 3;
break;
- case AT91SAM9260_ID_US3:
+ case 4:
configure_usart3_pins(pins);
start = AT91SAM9260_BASE_US3;
- id = 4;
break;
- case AT91SAM9260_ID_US4:
+ case 5:
configure_usart4_pins();
start = AT91SAM9260_BASE_US4;
- id = 5;
break;
- case AT91SAM9260_ID_US5:
+ case 6:
configure_usart5_pins();
start = AT91SAM9260_BASE_US5;
- id = 6;
break;
default:
return NULL;
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index ab9ebaf91..82d17a275 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -211,22 +211,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
case 0: /* DBGU */
configure_dbgu_pins();
start = AT91_BASE_SYS + AT91_DBGU;
- id = 0;
break;
- case AT91SAM9261_ID_US0:
+ case 1:
configure_usart0_pins(pins);
start = AT91SAM9261_BASE_US0;
- id = 1;
break;
- case AT91SAM9261_ID_US1:
+ case 2:
configure_usart1_pins(pins);
start = AT91SAM9261_BASE_US1;
- id = 2;
break;
- case AT91SAM9261_ID_US2:
+ case 3:
configure_usart2_pins(pins);
start = AT91SAM9261_BASE_US2;
- id = 3;
break;
default:
return NULL;
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 4ad9b8df5..4500d813f 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -261,22 +261,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
case 0: /* DBGU */
configure_dbgu_pins();
start = AT91_BASE_SYS + AT91_DBGU;
- id = 0;
break;
- case AT91SAM9263_ID_US0:
+ case 1:
configure_usart0_pins(pins);
start = AT91SAM9263_BASE_US0;
- id = 1;
break;
- case AT91SAM9263_ID_US1:
+ case 2:
configure_usart1_pins(pins);
start = AT91SAM9263_BASE_US1;
- id = 2;
break;
- case AT91SAM9263_ID_US2:
+ case 3:
configure_usart2_pins(pins);
start = AT91SAM9263_BASE_US2;
- id = 3;
break;
default:
return NULL;
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index e68e72d1b..273cd0eec 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -190,27 +190,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
case 0: /* DBGU */
configure_dbgu_pins();
start = AT91_BASE_SYS + AT91_DBGU;
- id = 0;
break;
- case AT91SAM9G45_ID_US0:
+ case 1:
configure_usart0_pins(pins);
start = AT91SAM9G45_BASE_US0;
- id = 1;
break;
- case AT91SAM9G45_ID_US1:
+ case 2:
configure_usart1_pins(pins);
start = AT91SAM9G45_BASE_US1;
- id = 2;
break;
- case AT91SAM9G45_ID_US2:
+ case 3:
configure_usart2_pins(pins);
start = AT91SAM9G45_BASE_US2;
- id = 3;
break;
- case AT91SAM9G45_ID_US3:
+ case 4:
configure_usart3_pins(pins);
start = AT91SAM9G45_BASE_US3;
- id = 4;
break;
default:
return NULL;
diff --git a/commands/echo.c b/commands/echo.c
index 114c1ba66..a19d99292 100644
--- a/commands/echo.c
+++ b/commands/echo.c
@@ -115,9 +115,9 @@ BAREBOX_CMD_HELP_START(echo)
BAREBOX_CMD_HELP_USAGE("echo [OPTIONS] [STRING]\n")
BAREBOX_CMD_HELP_SHORT("Display a line of text.\n")
BAREBOX_CMD_HELP_OPT ("-n", "do not output the trailing newline\n")
-BAREBOX_CMD_HELP_OPT ("-a", "FIXME\n")
-BAREBOX_CMD_HELP_OPT ("-o", "FIXME\n")
-BAREBOX_CMD_HELP_OPT ("-e", "FIXME\n")
+BAREBOX_CMD_HELP_OPT ("-a <file>", "instead of outputting to stdout append to <file>\n")
+BAREBOX_CMD_HELP_OPT ("-o <file>", "instead of outputting to stdout overwrite <file>\n")
+BAREBOX_CMD_HELP_OPT ("-e", "recognize escape sequences\n")
BAREBOX_CMD_HELP_END
/**
diff --git a/commands/i2c.c b/commands/i2c.c
index 36d80f3a4..763db8a1a 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -177,7 +177,7 @@ static int do_i2c_read(int argc, char *argv[])
}
}
- if ((addr < 0) || (reg < 0) || (count == 0) || (addr > 0x7F))
+ if ((addr < 0) || (reg < 0) || (count < 1) || (addr > 0x7F))
return COMMAND_ERROR_USAGE;
adapter = i2c_get_adapter(bus);
diff --git a/common/complete.c b/common/complete.c
index 0b03d7ce9..0780888ca 100644
--- a/common/complete.c
+++ b/common/complete.c
@@ -272,7 +272,7 @@ static char* cmd_complete_lookup(struct string_list *sl, char *instr)
{
struct command *cmdtp;
int len;
- int ret = 1;
+ int ret = COMPLETE_END;
char *res = NULL;
for_each_command(cmdtp) {
diff --git a/common/hush.c b/common/hush.c
index d915f9ed5..3d51e4cc1 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1590,6 +1590,7 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
if (rcode != 1 && ctx->old_flag != 0) {
syntax();
+ return 1;
}
if (rcode != 1 && ctx->old_flag == 0) {
done_word(&temp, ctx);
@@ -1614,8 +1615,9 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
inp->__promptme = 1;
temp.nonnull = 0;
temp.quote = 0;
- inp->p = NULL;
- free_pipe_list(ctx->list_head, 0);
+ free_pipe_list(ctx->list_head,0);
+ b_free(&temp);
+ return 1;
}
b_free(&temp);
} while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP)); /* loop on syntax errors, return on EOF */
diff --git a/common/memory.c b/common/memory.c
index faff33b41..3b4a5ef4b 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -58,7 +58,7 @@ void mem_malloc_init(void *start, void *end)
malloc_end = (unsigned long)end;
malloc_brk = malloc_start;
#ifdef CONFIG_MALLOC_TLSF
- tlsf_mem_pool = tlsf_create(start, (char *)end - (char *)start);
+ tlsf_mem_pool = tlsf_create(start, end - start + 1);
#endif
}
diff --git a/common/uimage.c b/common/uimage.c
index 4933c4058..945f3d6b0 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -404,8 +404,12 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)
res = NULL;
goto out;
}
- if (now < BUFSIZ)
+
+ if (now < BUFSIZ) {
+ release_sdram_region(res);
+ res = request_sdram_region("image", adr, ofs + now);
goto out;
+ }
release_sdram_region(res);
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index ad7cb7ece..f9477a354 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -38,9 +38,6 @@ static struct mc13xxx *mc_dev;
struct mc13xxx *mc13xxx_get(void)
{
- if (!mc_dev)
- return NULL;
-
return mc_dev;
}
EXPORT_SYMBOL(mc13xxx_get);
@@ -308,6 +305,7 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
rev = mc13xxx_query_revision(mc_dev);
if (rev < 0) {
free(mc_dev);
+ mc_dev = NULL;
return -EINVAL;
}
diff --git a/net/dns.c b/net/dns.c
index e13d65421..eb96c5760 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -197,6 +197,7 @@ static void dns_handler(void *ctx, char *packet, unsigned len)
IPaddr_t resolv(char *host)
{
IPaddr_t ip;
+ const char *ns;
if (!string_to_ip(host, &ip))
return ip;
@@ -205,8 +206,14 @@ IPaddr_t resolv(char *host)
dns_state = STATE_INIT;
- ip = getenv_ip("net.nameserver");
- if (!ip)
+ ns = getenv("net.nameserver");
+ if (!ns || !*ns) {
+ printk("%s: no nameserver specified in $net.nameserver\n",
+ __func__);
+ return 0;
+ }
+
+ if (string_to_ip(ns, &ip))
return 0;
debug("resolving host %s via nameserver %s\n", host, ip_to_string(ip));