summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xMAKEALL16
-rw-r--r--arch/arm/configs/archosg9_xload_defconfig2
-rw-r--r--arch/arm/configs/omap3530_beagle_xload_defconfig2
-rw-r--r--arch/arm/configs/panda_xload_defconfig2
-rw-r--r--arch/arm/configs/pcm049_xload_defconfig2
-rw-r--r--arch/arm/configs/phycard_a_l1_xload_defconfig2
-rw-r--r--arch/arm/configs/phycard_a_xl2_xload_defconfig2
-rw-r--r--arch/arm/cpu/mmu.c43
-rw-r--r--arch/arm/include/asm/mmu.h17
-rw-r--r--arch/arm/lib/barebox.lds.S2
-rw-r--r--arch/blackfin/boards/ipe337/barebox.lds.S2
-rw-r--r--arch/blackfin/include/asm/mmu.h18
-rw-r--r--arch/mips/include/asm/mmu.h18
-rw-r--r--arch/mips/lib/barebox.lds.S2
-rw-r--r--arch/nios2/cpu/barebox.lds.S1
-rw-r--r--arch/nios2/include/asm/mmu.h18
-rw-r--r--arch/openrisc/include/asm/mmu.h18
-rw-r--r--arch/ppc/boards/freescale-p2020rdb/barebox.lds.S1
-rw-r--r--arch/ppc/boards/pcm030/barebox.lds.S1
-rw-r--r--arch/ppc/include/asm/mmu.h18
-rw-r--r--arch/sandbox/include/asm/mmu.h18
-rw-r--r--arch/x86/include/asm/mmu.h18
-rw-r--r--arch/x86/lib/barebox.lds.S2
-rw-r--r--commands/Kconfig3
-rw-r--r--commands/bootm.c16
-rw-r--r--commands/reset.c23
-rw-r--r--common/Kconfig22
-rw-r--r--common/Makefile1
-rw-r--r--common/console_none.c42
-rw-r--r--common/memory.c4
-rw-r--r--defaultenv-2/base/bin/init18
-rw-r--r--defaultenv-2/base/init/ps19
-rw-r--r--drivers/serial/Kconfig1
-rw-r--r--drivers/usb/gadget/Kconfig2
-rw-r--r--drivers/w1/slaves/Kconfig4
-rw-r--r--drivers/w1/slaves/w1_ds2433.c43
-rw-r--r--fs/tftp.c21
-rw-r--r--include/asm-generic/sections.h1
-rw-r--r--include/common.h2
-rw-r--r--include/stdio.h64
-rw-r--r--net/Kconfig1
41 files changed, 421 insertions, 81 deletions
diff --git a/MAKEALL b/MAKEALL
index c08e484cda..18ed86216a 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -56,6 +56,7 @@ usage() {
echo "JOBS -j jobs"
echo "BUILDDIR -O build dir"
echo "LOGDIR -l log dir"
+ echo "REGEX -e regex"
echo ""
}
@@ -152,8 +153,9 @@ do_build_target() {
do_build() {
local arch=$1
+ local regex=$2
- for i in arch/${arch}/configs/*_defconfig
+ find arch/${arch}/configs -name "${regex}_defconfig" | while read i
do
local target=$(basename $i)
@@ -178,7 +180,7 @@ do_build_all() {
return $build_target
}
-while getopts "hc:j:O:l:a:" Option
+while getopts "hc:j:O:l:a:e:" Option
do
case $Option in
a )
@@ -196,6 +198,9 @@ case $Option in
O )
BUILDDIR=${OPTARG}
;;
+ e )
+ REGEX=${OPTARG}
+ ;;
h )
usage
exit 0
@@ -241,6 +246,11 @@ fi
[ -d "${LOGDIR}" ] || mkdir ${LOGDIR} || exit 1
+if [ ! "${REGEX}" ]
+then
+ REGEX="*"
+fi
+
if [ ! "${CONFIG}" ] && [ ! "${CROSS_COMPILE+set}" ]
then
echo "You need to specify a CONFIG or a CROSS_COMPILE"
@@ -262,7 +272,7 @@ fi
if [ $# -eq 0 ]
then
- do_build ${ARCH}
+ do_build ${ARCH} "${REGEX}"
else
do_build_target ${ARCH} $1
fi
diff --git a/arch/arm/configs/archosg9_xload_defconfig b/arch/arm/configs/archosg9_xload_defconfig
index 6c6782f8ea..83743fa944 100644
--- a/arch/arm/configs/archosg9_xload_defconfig
+++ b/arch/arm/configs/archosg9_xload_defconfig
@@ -15,7 +15,7 @@ CONFIG_MALLOC_SIZE=0x2000000
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
# CONFIG_SPI is not set
diff --git a/arch/arm/configs/omap3530_beagle_xload_defconfig b/arch/arm/configs/omap3530_beagle_xload_defconfig
index d951b1c98b..244891b3c8 100644
--- a/arch/arm/configs/omap3530_beagle_xload_defconfig
+++ b/arch/arm/configs/omap3530_beagle_xload_defconfig
@@ -14,7 +14,7 @@ CONFIG_PROMPT="X-load Beagle>"
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
diff --git a/arch/arm/configs/panda_xload_defconfig b/arch/arm/configs/panda_xload_defconfig
index fec09cec94..1ed20a157d 100644
--- a/arch/arm/configs/panda_xload_defconfig
+++ b/arch/arm/configs/panda_xload_defconfig
@@ -14,7 +14,7 @@ CONFIG_PROMPT="barebox> "
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
diff --git a/arch/arm/configs/pcm049_xload_defconfig b/arch/arm/configs/pcm049_xload_defconfig
index b6d3a7a376..9dfc30d953 100644
--- a/arch/arm/configs/pcm049_xload_defconfig
+++ b/arch/arm/configs/pcm049_xload_defconfig
@@ -17,7 +17,7 @@ CONFIG_PROMPT="barebox> "
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
diff --git a/arch/arm/configs/phycard_a_l1_xload_defconfig b/arch/arm/configs/phycard_a_l1_xload_defconfig
index 30253cba1c..5901ed10ab 100644
--- a/arch/arm/configs/phycard_a_l1_xload_defconfig
+++ b/arch/arm/configs/phycard_a_l1_xload_defconfig
@@ -20,7 +20,7 @@ CONFIG_CBSIZE=128
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
diff --git a/arch/arm/configs/phycard_a_xl2_xload_defconfig b/arch/arm/configs/phycard_a_xl2_xload_defconfig
index 797522065a..84160e3418 100644
--- a/arch/arm/configs/phycard_a_xl2_xload_defconfig
+++ b/arch/arm/configs/phycard_a_xl2_xload_defconfig
@@ -17,7 +17,7 @@ CONFIG_PROMPT="barebox> "
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
-# CONFIG_CONSOLE_FULL is not set
+CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 4b6db37d4b..8f9a43e040 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -73,11 +73,25 @@ extern int arm_architecture;
#define PTE_FLAGS_CACHED_V4 (PTE_SMALL_AP_UNO_SRW | PTE_BUFFERABLE | PTE_CACHEABLE)
#define PTE_FLAGS_UNCACHED_V4 PTE_SMALL_AP_UNO_SRW
-static uint32_t PTE_FLAGS_CACHED;
-static uint32_t PTE_FLAGS_UNCACHED;
+/*
+ * PTE flags to set cached and uncached areas.
+ * This will be determined at runtime.
+ */
+static uint32_t pte_flags_cached;
+static uint32_t pte_flags_uncached;
#define PTE_MASK ((1 << 12) - 1)
+uint32_t mmu_get_pte_cached_flags()
+{
+ return pte_flags_cached;
+}
+
+uint32_t mmu_get_pte_uncached_flags()
+{
+ return pte_flags_uncached;
+}
+
/*
* Create a second level translation table for the given virtual address.
* We initially create a flat uncached mapping on it.
@@ -93,7 +107,7 @@ static u32 *arm_create_pte(unsigned long virt)
ttb[virt >> 20] = (unsigned long)table | PMD_TYPE_TABLE;
for (i = 0; i < 256; i++) {
- table[i] = virt | PTE_TYPE_SMALL | PTE_FLAGS_UNCACHED;
+ table[i] = virt | PTE_TYPE_SMALL | pte_flags_uncached;
virt += PAGE_SIZE;
}
@@ -114,7 +128,7 @@ static u32 *find_pte(unsigned long adr)
return &table[(adr >> PAGE_SHIFT) & 0xff];
}
-static void remap_range(void *_start, size_t size, uint32_t flags)
+void remap_range(void *_start, size_t size, uint32_t flags)
{
unsigned long start = (unsigned long)_start;
u32 *p;
@@ -176,7 +190,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank)
for (i = 0; i < num_ptes; i++) {
ptes[i] = (phys + i * 4096) | PTE_TYPE_SMALL |
- PTE_FLAGS_CACHED;
+ pte_flags_cached;
}
pte = 0;
@@ -238,9 +252,10 @@ static void vectors_init(void)
memcpy(vectors, __exceptions_start, __exceptions_stop - __exceptions_start);
if (cr & CR_V)
- exc[256 - 16] = (u32)vectors | PTE_TYPE_SMALL | PTE_FLAGS_CACHED;
+ exc[256 - 16] = (u32)vectors | PTE_TYPE_SMALL |
+ pte_flags_cached;
else
- exc[0] = (u32)vectors | PTE_TYPE_SMALL | PTE_FLAGS_CACHED;
+ exc[0] = (u32)vectors | PTE_TYPE_SMALL | pte_flags_cached;
}
/*
@@ -254,11 +269,11 @@ static int mmu_init(void)
arm_set_cache_functions();
if (cpu_architecture() >= CPU_ARCH_ARMv7) {
- PTE_FLAGS_CACHED = PTE_FLAGS_CACHED_V7;
- PTE_FLAGS_UNCACHED = PTE_FLAGS_UNCACHED_V7;
+ pte_flags_cached = PTE_FLAGS_CACHED_V7;
+ pte_flags_uncached = PTE_FLAGS_UNCACHED_V7;
} else {
- PTE_FLAGS_CACHED = PTE_FLAGS_CACHED_V4;
- PTE_FLAGS_UNCACHED = PTE_FLAGS_UNCACHED_V4;
+ pte_flags_cached = PTE_FLAGS_CACHED_V4;
+ pte_flags_uncached = PTE_FLAGS_UNCACHED_V4;
}
ttb = memalign(0x10000, 0x4000);
@@ -315,8 +330,6 @@ void mmu_disable(void)
__mmu_cache_off();
}
-#define PAGE_ALIGN(s) (((s) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
-
void *dma_alloc_coherent(size_t size)
{
void *ret;
@@ -326,7 +339,7 @@ void *dma_alloc_coherent(size_t size)
dma_inv_range((unsigned long)ret, (unsigned long)ret + size);
- remap_range(ret, size, PTE_FLAGS_UNCACHED);
+ remap_range(ret, size, pte_flags_uncached);
return ret;
}
@@ -343,7 +356,7 @@ void *phys_to_virt(unsigned long phys)
void dma_free_coherent(void *mem, size_t size)
{
- remap_range(mem, size, PTE_FLAGS_CACHED);
+ remap_range(mem, size, pte_flags_cached);
free(mem);
}
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index a66da8c0a8..f32cea639d 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -41,7 +41,10 @@ void dma_flush_range(unsigned long, unsigned long);
void dma_inv_range(unsigned long, unsigned long);
unsigned long virt_to_phys(void *virt);
void *phys_to_virt(unsigned long phys);
+void remap_range(void *_start, size_t size, uint32_t flags);
void *map_io_sections(unsigned long physaddr, void *start, size_t size);
+uint32_t mmu_get_pte_cached_flags(void);
+uint32_t mmu_get_pte_uncached_flags(void);
#else
static inline void *dma_alloc_coherent(size_t size)
@@ -76,11 +79,25 @@ static inline void dma_inv_range(unsigned long s, unsigned long e)
{
}
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
static inline void *map_io_sections(unsigned long phys, void *start, size_t size)
{
return (void *)phys;
}
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
#endif
#ifdef CONFIG_CACHE_L2X0
diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S
index bac1a04f87..e5aee8cd82 100644
--- a/arch/arm/lib/barebox.lds.S
+++ b/arch/arm/lib/barebox.lds.S
@@ -66,6 +66,7 @@ SECTIONS
}
#endif
_etext = .; /* End of text and rodata section */
+ _sdata = .;
. = ALIGN(4);
.data : { *(.data*) }
@@ -87,6 +88,7 @@ SECTIONS
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
+ _edata = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss*) }
diff --git a/arch/blackfin/boards/ipe337/barebox.lds.S b/arch/blackfin/boards/ipe337/barebox.lds.S
index 6a07b43a1c..21a91eeb0a 100644
--- a/arch/blackfin/boards/ipe337/barebox.lds.S
+++ b/arch/blackfin/boards/ipe337/barebox.lds.S
@@ -55,6 +55,7 @@ SECTIONS
.rodata : { *(.rodata) }
__etext = .; /* End of text and rodata section */
+ __sdata = .;
. = ALIGN(4);
.data : { *(.data) }
@@ -79,6 +80,7 @@ SECTIONS
__usymtab : { BAREBOX_SYMS }
___usymtab_end = .;
+ __edata = .;
. = ALIGN(4);
___bss_start = .;
.bss : { *(.bss) }
diff --git a/arch/blackfin/include/asm/mmu.h b/arch/blackfin/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/blackfin/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/mips/include/asm/mmu.h b/arch/mips/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/mips/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index 0cbf2d71ee..5b3d45dc3c 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -44,6 +44,7 @@ SECTIONS
.rodata : { *(.rodata*) }
_etext = .; /* End of text and rodata section */
+ _sdata = .;
. = ALIGN(4);
.data : { *(.data*) }
@@ -68,6 +69,7 @@ SECTIONS
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
+ _edata = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss*) }
diff --git a/arch/nios2/cpu/barebox.lds.S b/arch/nios2/cpu/barebox.lds.S
index af7be4de3c..943c507531 100644
--- a/arch/nios2/cpu/barebox.lds.S
+++ b/arch/nios2/cpu/barebox.lds.S
@@ -74,6 +74,7 @@ SECTIONS
* adjacent to simplify the startup code -- and provide
* the global pointer for gp-relative access.
*/
+ _sdata = .;
_data = .;
.data :
{
diff --git a/arch/nios2/include/asm/mmu.h b/arch/nios2/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/nios2/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/openrisc/include/asm/mmu.h b/arch/openrisc/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/openrisc/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/ppc/boards/freescale-p2020rdb/barebox.lds.S b/arch/ppc/boards/freescale-p2020rdb/barebox.lds.S
index 95033d4904..85a864ec85 100644
--- a/arch/ppc/boards/freescale-p2020rdb/barebox.lds.S
+++ b/arch/ppc/boards/freescale-p2020rdb/barebox.lds.S
@@ -41,6 +41,7 @@ SECTIONS
_etext = .;
PROVIDE (etext = .);
+ _sdata = .;
.rodata :
{
diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S
index cc86d82db6..20ac0d8a06 100644
--- a/arch/ppc/boards/pcm030/barebox.lds.S
+++ b/arch/ppc/boards/pcm030/barebox.lds.S
@@ -69,6 +69,7 @@ SECTIONS
. = (. + 0x0FFF) & 0xFFFFF000;
_etext = .;
PROVIDE (erotext = .);
+ _sdata = .;
.reloc :
{
*(.got)
diff --git a/arch/ppc/include/asm/mmu.h b/arch/ppc/include/asm/mmu.h
index b2dd0b7b2b..179ec2b1a9 100644
--- a/arch/ppc/include/asm/mmu.h
+++ b/arch/ppc/include/asm/mmu.h
@@ -540,4 +540,22 @@ extern int write_bat(ppc_bat_t bat, unsigned long upper, unsigned long lower);
(rt<<21)|(ra<<16)|(ws<<11)|(946<<1)
#endif
+
+#ifndef __ASSEMBLY__
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+#endif
+
#endif /* _PPC_MMU_H_ */
diff --git a/arch/sandbox/include/asm/mmu.h b/arch/sandbox/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/sandbox/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
new file mode 100644
index 0000000000..bf654206ac
--- /dev/null
+++ b/arch/x86/include/asm/mmu.h
@@ -0,0 +1,18 @@
+#ifndef __ASM_MMU_H
+#define __ASM_MMU_H
+
+static inline void remap_range(void *_start, size_t size, uint32_t flags)
+{
+}
+
+static inline uint32_t mmu_get_pte_cached_flags(void)
+{
+ return 0;
+}
+
+static inline uint32_t mmu_get_pte_uncached_flags(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_MMU_H */
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index 8bd2a7b30e..05d0f778e5 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -153,6 +153,7 @@ SECTIONS
} > barebox
BAREBOX_BARE_INIT_SIZE
+ _sdata = .;
.data : AT ( LOADADDR(.text) + SIZEOF(.text) ) {
*(.data*)
. = ALIGN(4);
@@ -191,6 +192,7 @@ SECTIONS
. = ALIGN(4);
} > barebox
+ _edata = .;
.bss : {
__bss_start = .;
*(.bss*);
diff --git a/commands/Kconfig b/commands/Kconfig
index c9a53b773e..1addd91d24 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -267,6 +267,7 @@ endmenu
menu "memory"
config CMD_LOADB
+ depends on !CONSOLE_NONE
select CRC16
tristate
prompt "loadb"
@@ -274,10 +275,12 @@ config CMD_LOADB
config CMD_LOADY
select CRC16
select XYMODEM
+ depends on !CONSOLE_NONE
tristate
prompt "loady"
config CMD_LOADS
+ depends on !CONSOLE_NONE
tristate
prompt "loads"
diff --git a/commands/bootm.c b/commands/bootm.c
index 483e6a1933..5ccf2372ac 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -143,8 +143,7 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu
size_t size;
unsigned int align;
- if (bootm_verbose(data))
- printf("Loading oftree from '%s'\n", oftree);
+ printf("Loading devicetree from '%s'\n", oftree);
ft = file_name_detect_type(oftree);
if ((int)ft < 0) {
@@ -380,13 +379,14 @@ static int do_bootm(int argc, char *argv[])
}
}
+ printf("\nLoading OS %s '%s'", file_type_to_string(os_type),
+ data.os_file);
+ if (os_type == filetype_uimage &&
+ data.os->header.ih_type == IH_TYPE_MULTI)
+ printf(", multifile image %d", data.os_num);
+ printf("\n");
+
if (bootm_verbose(&data)) {
- printf("\nLoading OS %s '%s'", file_type_to_string(os_type),
- data.os_file);
- if (os_type == filetype_uimage &&
- data.os->header.ih_type == IH_TYPE_MULTI)
- printf(", multifile image %d", data.os_num);
- printf("\n");
if (data.os_res)
printf("OS image is at 0x%08x-0x%08x\n",
data.os_res->start,
diff --git a/commands/reset.c b/commands/reset.c
index 835926b270..79885f4afc 100644
--- a/commands/reset.c
+++ b/commands/reset.c
@@ -20,17 +20,40 @@
#include <common.h>
#include <command.h>
#include <complete.h>
+#include <getopt.h>
static int cmd_reset(int argc, char *argv[])
{
+ int opt, shutdown_flag;
+
+ shutdown_flag = 1;
+
+ while ((opt = getopt(argc, argv, "f")) > 0) {
+ switch (opt) {
+ case 'f':
+ shutdown_flag = 0;
+ break;
+ }
+ }
+
+ if (shutdown_flag)
+ shutdown_barebox();
+
reset_cpu(0);
/* Not reached */
return 1;
}
+BAREBOX_CMD_HELP_START(reset)
+BAREBOX_CMD_HELP_USAGE("reset [-f]\n")
+BAREBOX_CMD_HELP_SHORT("Perform RESET of the CPU.\n")
+BAREBOX_CMD_HELP_OPT("-f", "force RESET, don't call shutdown\n")
+BAREBOX_CMD_HELP_END
+
BAREBOX_CMD_START(reset)
.cmd = cmd_reset,
.usage = "Perform RESET of the CPU",
+ BAREBOX_CMD_HELP(cmd_reset_help)
BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/common/Kconfig b/common/Kconfig
index 42a54f7988..609b6d95a4 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -460,10 +460,13 @@ config TIMESTAMP
commands like bootm or iminfo. This option is
automatically enabled when you select CFG_CMD_DATE .
+choice
+ prompt "console support"
+ default CONSOLE_FULL
+
config CONSOLE_FULL
bool
- default y
- prompt "Enable full console support"
+ prompt "full"
help
This option enables full console support capable of
handling multiple consoles. Also the full console support
@@ -472,6 +475,16 @@ config CONSOLE_FULL
once the first console is registered. Recommended for most
usecases.
+config CONSOLE_SIMPLE
+ bool
+ prompt "simple"
+
+config CONSOLE_NONE
+ bool
+ prompt "none"
+
+endchoice
+
choice
prompt "Console activation strategy"
depends on CONSOLE_FULL
@@ -504,11 +517,6 @@ config CONSOLE_ACTIVATE_NONE
endchoice
-config CONSOLE_SIMPLE
- bool
- default y
- depends on !CONSOLE_FULL
-
config PARTITION
bool
prompt "Enable Partitions"
diff --git a/common/Makefile b/common/Makefile
index d82fc998bc..7206eed8b1 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_MEMINFO) += meminfo.o
obj-$(CONFIG_COMMAND_SUPPORT) += command.o
obj-$(CONFIG_CONSOLE_FULL) += console.o
obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o
+obj-$(CONFIG_CONSOLE_NONE) += console_none.o
obj-$(CONFIG_DIGEST) += digest.o
obj-$(CONFIG_ENVIRONMENT_VARIABLES) += env.o
obj-$(CONFIG_UIMAGE) += image.o
diff --git a/common/console_none.c b/common/console_none.c
new file mode 100644
index 0000000000..b6018148d2
--- /dev/null
+++ b/common/console_none.c
@@ -0,0 +1,42 @@
+#include <config.h>
+#include <common.h>
+#include <fs.h>
+#include <errno.h>
+#include <debug_ll.h>
+
+int fputc(int fd, char c)
+{
+ if (fd != 1 && fd != 2)
+ return write(fd, &c, 1);
+ return 0;
+}
+EXPORT_SYMBOL(fputc);
+
+int fputs(int fd, const char *s)
+{
+ if (fd != 1 && fd != 2)
+ return write(fd, s, strlen(s));
+ return 0;
+}
+EXPORT_SYMBOL(fputs);
+
+int fprintf(int file, const char *fmt, ...)
+{
+ va_list args;
+ uint i;
+ char printbuffer[CFG_PBSIZE];
+
+ va_start (args, fmt);
+
+ /* For this to work, printbuffer must be larger than
+ * anything we ever want to print.
+ */
+ i = vsprintf (printbuffer, fmt, args);
+ va_end (args);
+
+ /* Print the string */
+ fputs(file, printbuffer);
+
+ return i;
+}
+EXPORT_SYMBOL(fprintf);
diff --git a/common/memory.c b/common/memory.c
index 7dd13849c6..81641f0527 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -75,6 +75,10 @@ static int mem_malloc_resource(void)
(unsigned long)&_stext,
(unsigned long)&_etext -
(unsigned long)&_stext);
+ request_sdram_region("barebox data",
+ (unsigned long)&_sdata,
+ (unsigned long)&_edata -
+ (unsigned long)&_sdata);
request_sdram_region("bss",
(unsigned long)&__bss_start,
(unsigned long)&__bss_stop -
diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index bb4abcdec9..b606b634a2 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -15,20 +15,15 @@ global editcmd=sedit
/env/config
-if [ ${global.allow_color} = "true" ]; then
- export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m "
-else
- export PS1="barebox@\h:\w "
-fi
-
if [ -e /env/menu ]; then
echo -e -n "\nHit m for menu or any other key to stop autoboot: "
else
echo -e -n "\nHit any key to stop autoboot: "
fi
-timeout -a $global.autoboot_timeout -v key
-autoboot="$?"
+# allow to stop the boot before execute the /env/init/*
+# but without waiting
+timeout -s -a -v key 0
if [ "${key}" = "q" ]; then
exit
@@ -38,6 +33,13 @@ for i in /env/init/*; do
. $i
done
+timeout -a $global.autoboot_timeout -v key
+autoboot="$?"
+
+if [ "${key}" = "q" ]; then
+ exit
+fi
+
if [ "$autoboot" = 0 ]; then
boot
fi
diff --git a/defaultenv-2/base/init/ps1 b/defaultenv-2/base/init/ps1
new file mode 100644
index 0000000000..fcbf4b63f4
--- /dev/null
+++ b/defaultenv-2/base/init/ps1
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+/env/config
+
+if [ ${global.allow_color} = "true" ]; then
+ export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m "
+else
+ export PS1="barebox@\h:\w "
+fi
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index a8be9cdc8d..f61d6708a4 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1,4 +1,5 @@
menu "serial drivers"
+ depends on !CONSOLE_NONE
config DRIVER_SERIAL_ARM_DCC
depends on ARM
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 6501d42873..5f65cea984 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -44,7 +44,7 @@ config USB_GADGET_DFU
config USB_GADGET_SERIAL
bool
- depends on EXPERIMENTAL
+ depends on EXPERIMENTAL && !CONSOLE_NONE
prompt "Serial Gadget"
endif
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
index 946a0b3bbe..19942ad1df 100644
--- a/drivers/w1/slaves/Kconfig
+++ b/drivers/w1/slaves/Kconfig
@@ -15,10 +15,10 @@ config W1_SLAVE_DS2431_WRITE
depends on W1_SLAVE_DS2431
config W1_SLAVE_DS2433
- bool "4kb EEPROM family support (DS2433)"
+ bool "EEPROM family support (DS2433 4Kb or DS28EC20 20kb)"
help
Say Y here if you want to use a 1-wire
- 4kb EEPROM family device (DS2433).
+ EEPROM family device (DS2433 4Kb or DS28EC20 20kb).
config W1_SLAVE_DS2433_WRITE
bool "write support"
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 51279fb0eb..a840d9a2f2 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -10,8 +10,6 @@
#include <init.h>
#include "../w1.h"
-#define W1_EEPROM_SIZE 512
-#define W1_PAGE_COUNT 16
#define W1_PAGE_SIZE 32
#define W1_PAGE_BITS 5
#define W1_PAGE_MASK 0x1F
@@ -23,9 +21,8 @@
#define W1_F23_READ_SCRATCH 0xAA
#define W1_F23_COPY_SCRATCH 0x55
-#define DRIVERNAME "ds2433"
-
static int ds2433_count = 0;
+static int ds28ec20_count = 0;
/**
* Check the file size bounds and adjusts count as needed.
@@ -49,7 +46,7 @@ static ssize_t ds2433_cdev_read(struct cdev *cdev, void *buf, size_t count,
struct w1_bus *bus = dev->bus;
u8 wrbuf[3];
- if ((count = ds2433_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
+ if ((count = ds2433_fix_count(off, count, cdev->size)) == 0)
return 0;
/* read directly from the EEPROM */
@@ -134,7 +131,7 @@ static ssize_t ds2433_cdev_write(struct cdev *cdev, const void *buf, size_t coun
int addr, len, idx;
const u8 *buf8 = buf;
- if ((count = ds2433_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
+ if ((count = ds2433_fix_count(off, count, cdev->size)) == 0)
return 0;
/* Can only write data to one page at a time */
@@ -165,7 +162,7 @@ static struct file_operations ds2433_ops = {
.lseek = dev_lseek_default,
};
-static int ds2433_probe(struct w1_device *dev)
+static int ds2433_cdev_create(struct w1_device *dev, int size, int id)
{
struct cdev *cdev;
@@ -173,24 +170,48 @@ static int ds2433_probe(struct w1_device *dev)
cdev->dev = &dev->dev;
cdev->priv = dev;
cdev->ops = &ds2433_ops;
- cdev->size = W1_EEPROM_SIZE;
- cdev->name = asprintf(DRIVERNAME"%d", ds2433_count++);
+ cdev->size = size;
+ cdev->name = asprintf("%s%d", dev->dev.driver->name, id);
if (cdev->name == NULL)
return -ENOMEM;
return devfs_create(cdev);
}
+static int ds2433_probe(struct w1_device *dev)
+{
+ return ds2433_cdev_create(dev, 512, ds2433_count++);
+}
+
+static int ds28ec20_probe(struct w1_device *dev)
+{
+ return ds2433_cdev_create(dev, 2560, ds28ec20_count++);
+}
+
struct w1_driver ds2433_driver = {
.drv = {
- .name = DRIVERNAME,
+ .name = "ds2433",
},
.probe = ds2433_probe,
.fid = 0x23,
};
+struct w1_driver ds28ec20_driver = {
+ .drv = {
+ .name = "ds28ec20",
+ },
+ .probe = ds28ec20_probe,
+ .fid = 0x43,
+};
+
static int w1_ds2433_init(void)
{
- return w1_driver_register(&ds2433_driver);
+ int ret;
+
+ ret = w1_driver_register(&ds2433_driver);
+ if (ret)
+ return ret;
+
+ return w1_driver_register(&ds28ec20_driver);
}
device_initcall(w1_ds2433_init);
diff --git a/fs/tftp.c b/fs/tftp.c
index b40353b686..f86a7d1b0f 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -246,6 +246,11 @@ static void tftp_parse_oack(struct file_priv *priv, unsigned char *pkt, int len)
}
}
+static void tftp_timer_reset(struct file_priv *priv)
+{
+ priv->progress_timeout = priv->resend_timeout = get_time_ns();
+}
+
static void tftp_handler(void *ctx, char *packet, unsigned len)
{
struct file_priv *priv = ctx;
@@ -282,6 +287,9 @@ static void tftp_handler(void *ctx, char *packet, unsigned len)
}
priv->block++;
+
+ tftp_timer_reset(priv);
+
if (priv->state == STATE_LAST) {
priv->state = STATE_DONE;
break;
@@ -335,6 +343,8 @@ static void tftp_handler(void *ctx, char *packet, unsigned len)
priv->last_block = priv->block;
+ tftp_timer_reset(priv);
+
kfifo_put(priv->fifo, pkt + 2, len);
if (len < priv->blocksize) {
@@ -364,11 +374,6 @@ static void tftp_handler(void *ctx, char *packet, unsigned len)
}
}
-static void tftp_timer_reset(struct file_priv *priv)
-{
- priv->progress_timeout = priv->resend_timeout = get_time_ns();
-}
-
static struct file_priv *tftp_do_open(struct device_d *dev,
int accmode, const char *filename)
{
@@ -549,8 +554,6 @@ static int tftp_read(struct device_d *dev, FILE *f, void *buf, size_t insize)
debug("%s %zu\n", __func__, insize);
- tftp_timer_reset(priv);
-
while (insize) {
now = kfifo_get(priv->fifo, buf, insize);
if (priv->state == STATE_DONE)
@@ -561,10 +564,8 @@ static int tftp_read(struct device_d *dev, FILE *f, void *buf, size_t insize)
insize -= now;
}
- if (TFTP_FIFO_SIZE - kfifo_len(priv->fifo) >= priv->blocksize) {
+ if (TFTP_FIFO_SIZE - kfifo_len(priv->fifo) >= priv->blocksize)
tftp_send(priv);
- tftp_timer_reset(priv);
- }
ret = tftp_poll(priv);
if (ret == TFTP_ERR_RESEND)
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 17d5fd1ae4..5492aa4d98 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -3,6 +3,7 @@
extern char _text[], _stext[], _etext[];
extern char __bss_start[], __bss_stop[];
+extern char _sdata[], _edata[];
extern char __bare_init_start[], __bare_init_end[];
extern char _end[];
extern void *_barebox_image_size;
diff --git a/include/common.h b/include/common.h
index 56347df2c4..e559b94a71 100644
--- a/include/common.h
+++ b/include/common.h
@@ -216,6 +216,8 @@ int run_shell(void);
#define PAGE_SIZE 4096
#define PAGE_SHIFT 12
+#define PAGE_ALIGN(s) (((s) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
+#define PAGE_ALIGN_DOWN(x) ((x) & ~(PAGE_SIZE - 1))
int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab);
diff --git a/include/stdio.h b/include/stdio.h
index 4901bc7182..5c091a8eab 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -11,6 +11,15 @@
/* serial stuff */
void serial_printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
+int sprintf(char *buf, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3)));
+int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format(__printf__, 3, 4)));
+int vsprintf(char *buf, const char *fmt, va_list args);
+char *asprintf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
+char *vasprintf(const char *fmt, va_list ap);
+int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
+
+#ifndef CONFIG_CONSOLE_NONE
/* stdin */
int tstc(void);
@@ -20,6 +29,51 @@ int getc(void);
int console_puts(unsigned int ch, const char *s);
void console_flush(void);
+
+int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
+int vprintf(const char *fmt, va_list args);
+#else
+static inline int tstc(void)
+{
+ return 0;
+}
+
+static inline int console_puts(unsigned int ch, const char *str)
+{
+ return 0;
+}
+
+static inline int getc(void)
+{
+ return -EINVAL;
+}
+
+static inline void console_putc(unsigned int ch, char c) {}
+
+static inline void console_flush(void) {}
+
+static int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
+static inline int printf(const char *fmt, ...)
+{
+ return 0;
+}
+
+
+static inline int vprintf(const char *fmt, va_list args)
+{
+ return 0;
+}
+
+#ifndef ARCH_HAS_CTRLC
+/* test if ctrl-c was pressed */
+static inline int ctrlc (void)
+{
+ return 0;
+}
+#endif /* ARCH_HAS_CTRC */
+
+#endif
+
static inline int puts(const char *s)
{
return console_puts(CONSOLE_STDOUT, s);
@@ -30,16 +84,6 @@ static inline void putchar(char c)
console_putc(CONSOLE_STDOUT, c);
}
-int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-int vprintf(const char *fmt, va_list args);
-int sprintf(char *buf, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3)));
-int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format(__printf__, 3, 4)));
-int vsprintf(char *buf, const char *fmt, va_list args);
-char *asprintf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-char *vasprintf(const char *fmt, va_list ap);
-int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
-int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
-
/* stderr */
#define eputc(c) console_putc(CONSOLE_STDERR, c)
#define eputs(s) console_puts(CONSOLE_STDERR, s)
diff --git a/net/Kconfig b/net/Kconfig
index acd92ffe20..c12193db5c 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -17,6 +17,7 @@ config NET_PING
config NET_NETCONSOLE
bool
+ depends on !CONSOLE_NONE
prompt "network console support"
help
This option adds support for a simple udp based network console.