diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig index 1dd7567..b66a653 100644 --- a/arch/arm/configs/am335x_mlo_defconfig +++ b/arch/arm/configs/am335x_mlo_defconfig @@ -9,6 +9,7 @@ # CONFIG_MEMINFO is not set CONFIG_MMU=y CONFIG_TEXT_BASE=0x0 +CONFIG_BAREBOX_MAX_PBLX_SIZE=0x1b400 CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_RELOCATABLE=y diff --git a/arch/arm/configs/lubbock_defconfig b/arch/arm/configs/lubbock_defconfig index bf04fa3..224854c 100644 --- a/arch/arm/configs/lubbock_defconfig +++ b/arch/arm/configs/lubbock_defconfig @@ -6,7 +6,6 @@ CONFIG_ARM_UNWIND=y # CONFIG_BANNER is not set CONFIG_MMU=y -CONFIG_TEXT_BASE=0xa3d00000 CONFIG_BAREBOX_MAX_BARE_INIT_SIZE=0x80000 CONFIG_MALLOC_SIZE=0x1000000 CONFIG_EXPERIMENTAL=y diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig index ca54a1a..ec369ae 100644 --- a/arch/arm/configs/socfpga_defconfig +++ b/arch/arm/configs/socfpga_defconfig @@ -1,70 +1,68 @@ CONFIG_ARCH_SOCFPGA=y -CONFIG_ARCH_SOCFPGA_FPGA=y CONFIG_MACH_SOCFPGA_EBV_SOCRATES=y CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT=y CONFIG_THUMB2_BAREBOX=y -CONFIG_CMD_ARM_MMUINFO=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_ARM_UNWIND=y CONFIG_MMU=y -CONFIG_TEXT_BASE=0x0 CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y CONFIG_RELOCATABLE=y -CONFIG_LONGHELP=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y # CONFIG_TIMESTAMP is not set CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_CMD_EDIT=y -CONFIG_CMD_SLEEP=y -CONFIG_CMD_MSLEEP=y -CONFIG_CMD_SAVEENV=y -CONFIG_CMD_EXPORT=y -CONFIG_CMD_PRINTENV=y -CONFIG_CMD_READLINE=y -CONFIG_CMD_LET=y -CONFIG_CMD_MENU=y -CONFIG_CMD_MENU_MANAGEMENT=y -CONFIG_CMD_TIME=y -CONFIG_CMD_LN=y -CONFIG_CMD_FILETYPE=y -CONFIG_CMD_ECHO_E=y -CONFIG_CMD_MEMINFO=y +CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y -CONFIG_CMD_MM=y -CONFIG_CMD_CRC=y -CONFIG_CMD_CRC_CMP=y -CONFIG_CMD_MD5SUM=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_ARM_MMUINFO=y CONFIG_CMD_BOOTM_SHOW_TYPE=y CONFIG_CMD_BOOTM_VERBOSE=y CONFIG_CMD_BOOTM_INITRD=y CONFIG_CMD_BOOTM_OFTREE=y -CONFIG_CMD_RESET=y CONFIG_CMD_GO=y -CONFIG_CMD_OFTREE=y -CONFIG_CMD_OF_PROPERTY=y -CONFIG_CMD_OF_NODE=y -CONFIG_CMD_MEMTEST=y -CONFIG_CMD_BAREBOX_UPDATE=y -CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_RESET=y CONFIG_CMD_PARTITION=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_GPIO=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_FILETYPE=y +CONFIG_CMD_LN=y +CONFIG_CMD_MD5SUM=y CONFIG_CMD_UNCOMPRESS=y -CONFIG_CMD_SPI=y -CONFIG_CMD_LED=y -CONFIG_CMD_LED_TRIGGER=y +CONFIG_CMD_LET=y +CONFIG_CMD_MSLEEP=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_DHCP=y CONFIG_CMD_MIITOOL=y +CONFIG_CMD_PING=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MM=y CONFIG_CMD_CLK=y CONFIG_CMD_DETECT=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_LED=y +CONFIG_CMD_SPI=y +CONFIG_CMD_LED_TRIGGER=y +CONFIG_CMD_BAREBOX_UPDATE=y +CONFIG_CMD_OF_NODE=y +CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OFTREE=y +CONFIG_CMD_TIME=y CONFIG_NET=y -CONFIG_CMD_DHCP=y -CONFIG_CMD_PING=y CONFIG_NET_NETCONSOLE=y CONFIG_NET_RESOLV=y CONFIG_OFDEVICE=y diff --git a/arch/arm/mach-clps711x/reset.c b/arch/arm/mach-clps711x/reset.c index 67c9c8b..859d8ae 100644 --- a/arch/arm/mach-clps711x/reset.c +++ b/arch/arm/mach-clps711x/reset.c @@ -11,7 +11,7 @@ void __noreturn reset_cpu(unsigned long addr) { - arch_shutdown(); + shutdown_barebox(); asm("mov pc, #0"); diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 610fb1c..2b7f631 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -4,6 +4,7 @@ hex default 0xa0000000 if MACH_MIOA701 default 0xa3f00000 if MACH_PCM027 + default 0xa3d00000 if MACH_LUBBOCK default 0x83f00000 if MACH_ZYLONITE # ---------------------------------------------------------- diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index 90b3533..73b26ef 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -1,5 +1,9 @@ if ARCH_SOCFPGA +config ARCH_TEXT_BASE + hex + default 0x0 + config ARCH_SOCFPGA_XLOAD bool prompt "Build preloader image" diff --git a/arch/arm/mach-tegra/include/mach/lowlevel.h b/arch/arm/mach-tegra/include/mach/lowlevel.h index 768b13d..0c76b88 100644 --- a/arch/arm/mach-tegra/include/mach/lowlevel.h +++ b/arch/arm/mach-tegra/include/mach/lowlevel.h @@ -243,11 +243,20 @@ while ((int)readl(TEGRA_TMRUS_BASE + TIMER_CNTR_1US) - timeout < 0); } +/* reset vector for the AVP, to be called from board reset vector */ +void tegra_avp_reset_vector(uint32_t boarddata); + +/* reset vector for the main CPU complex */ +void tegra_maincomplex_entry(void); + static __always_inline void tegra_cpu_lowlevel_setup(void) { uint32_t r; + if (tegra_cpu_is_maincomplex()) + tegra_maincomplex_entry(); + /* set the cpu to SVC32 mode */ __asm__ __volatile__("mrs %0, cpsr":"=r"(r)); r &= ~0x1f; @@ -258,10 +267,4 @@ tegra_ll_delay_setup(); } -/* reset vector for the AVP, to be called from board reset vector */ -void tegra_avp_reset_vector(uint32_t boarddata); - -/* reset vector for the main CPU complex */ -void tegra_maincomplex_entry(void); - #endif /* __TEGRA_LOWLEVEL_H */ diff --git a/arch/arm/mach-tegra/tegra_avp_init.c b/arch/arm/mach-tegra/tegra_avp_init.c index 91fd894..20fcf3f 100644 --- a/arch/arm/mach-tegra/tegra_avp_init.c +++ b/arch/arm/mach-tegra/tegra_avp_init.c @@ -265,9 +265,6 @@ /* put boarddata in scratch reg, for main CPU to fetch after startup */ writel(boarddata, TEGRA_PMC_BASE + PMC_SCRATCH(10)); - if (tegra_cpu_is_maincomplex()) - tegra_maincomplex_entry(); - /* we want to bring up the high performance CPU complex */ if (tegra_get_chiptype() >= TEGRA30) tegra_cluster_switch_hp(); diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h index 2837b6a..703104e 100644 --- a/arch/blackfin/include/asm/io.h +++ b/arch/blackfin/include/asm/io.h @@ -90,21 +90,21 @@ int cacheflag); extern void __iounmap(void *addr, unsigned long size); -extern inline void *ioremap(unsigned long physaddr, unsigned long size) +static inline void *ioremap(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -extern inline void *ioremap_nocache(unsigned long physaddr, +static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -extern inline void *ioremap_writethrough(unsigned long physaddr, +static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); } -extern inline void *ioremap_fullcache(unsigned long physaddr, +static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_FULL_CACHING); diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h index eaa1e4a..f463637 100644 --- a/arch/blackfin/include/asm/processor.h +++ b/arch/blackfin/include/asm/processor.h @@ -36,7 +36,7 @@ #include #include -extern inline unsigned long rdusp(void) +static inline unsigned long rdusp(void) { unsigned long usp; @@ -44,7 +44,7 @@ return usp; } -extern inline void wrusp(unsigned long usp) +static inline void wrusp(unsigned long usp) { __asm__ __volatile__("usp = %0;\n\t"::"da"(usp)); } @@ -130,7 +130,7 @@ /* * Return saved PC of a blocked thread. */ -extern inline unsigned long thread_saved_pc(struct thread_struct *t) +static inline unsigned long thread_saved_pc(struct thread_struct *t) { extern void scheduling_functions_start_here(void); extern void scheduling_functions_end_here(void); diff --git a/arch/blackfin/include/asm/swab.h b/arch/blackfin/include/asm/swab.h index 89de650..1f645db 100644 --- a/arch/blackfin/include/asm/swab.h +++ b/arch/blackfin/include/asm/swab.h @@ -12,7 +12,7 @@ #ifdef __GNUC__ -static __inline__ __attribute_const__ __u32 __arch_swahb32(__u32 xx) +static inline __attribute_const__ __u32 __arch_swahb32(__u32 xx) { __u32 tmp; __asm__("%1 = %0 >> 8 (V);\n\t" @@ -23,7 +23,7 @@ } #define __arch_swahb32 __arch_swahb32 -static __inline__ __attribute_const__ __u32 __arch_swahw32(__u32 xx) +static inline __attribute_const__ __u32 __arch_swahw32(__u32 xx) { __u32 rv; __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx)); @@ -31,13 +31,13 @@ } #define __arch_swahw32 __arch_swahw32 -static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 xx) +static inline __attribute_const__ __u32 __arch_swab32(__u32 xx) { return __arch_swahb32(__arch_swahw32(xx)); } #define __arch_swab32 __arch_swab32 -static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 xx) +static inline __attribute_const__ __u16 __arch_swab16(__u16 xx) { __u32 xw = xx; __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw)); diff --git a/arch/mips/mach-bcm47xx/reset.c b/arch/mips/mach-bcm47xx/reset.c index f1dc68a..00aee19 100644 --- a/arch/mips/mach-bcm47xx/reset.c +++ b/arch/mips/mach-bcm47xx/reset.c @@ -15,11 +15,6 @@ * */ -/** - * @file - * @brief Resetting an malta board - */ - #include #include #include diff --git a/arch/ppc/include/asm/atomic.h b/arch/ppc/include/asm/atomic.h index 23f22df..a98d892 100644 --- a/arch/ppc/include/asm/atomic.h +++ b/arch/ppc/include/asm/atomic.h @@ -21,7 +21,7 @@ extern void atomic_clear_mask(unsigned long mask, unsigned long *addr); extern void atomic_set_mask(unsigned long mask, unsigned long *addr); -extern __inline__ int atomic_add_return(int a, atomic_t *v) +static inline int atomic_add_return(int a, atomic_t *v) { int t; @@ -37,7 +37,7 @@ return t; } -extern __inline__ int atomic_sub_return(int a, atomic_t *v) +static inline int atomic_sub_return(int a, atomic_t *v) { int t; @@ -53,7 +53,7 @@ return t; } -extern __inline__ int atomic_inc_return(atomic_t *v) +static inline int atomic_inc_return(atomic_t *v) { int t; @@ -69,7 +69,7 @@ return t; } -extern __inline__ int atomic_dec_return(atomic_t *v) +static inline int atomic_dec_return(atomic_t *v) { int t; diff --git a/arch/ppc/include/asm/bitops.h b/arch/ppc/include/asm/bitops.h index e4572bc..2fdd57e 100644 --- a/arch/ppc/include/asm/bitops.h +++ b/arch/ppc/include/asm/bitops.h @@ -28,7 +28,7 @@ * These used to be if'd out here because using : "cc" as a constraint * resulted in errors from egcs. Things may be OK with gcc-2.95. */ -extern __inline__ void set_bit(int nr, volatile void * addr) +static inline void set_bit(int nr, volatile void * addr) { unsigned long old; unsigned long mask = 1 << (nr & 0x1f); @@ -45,7 +45,7 @@ : "cc" ); } -extern __inline__ void clear_bit(int nr, volatile void *addr) +static inline void clear_bit(int nr, volatile void *addr) { unsigned long old; unsigned long mask = 1 << (nr & 0x1f); @@ -62,7 +62,7 @@ : "cc"); } -extern __inline__ void change_bit(int nr, volatile void *addr) +static inline void change_bit(int nr, volatile void *addr) { unsigned long old; unsigned long mask = 1 << (nr & 0x1f); @@ -79,7 +79,7 @@ : "cc"); } -extern __inline__ int test_and_set_bit(int nr, volatile void *addr) +static inline int test_and_set_bit(int nr, volatile void *addr) { unsigned int old, t; unsigned int mask = 1 << (nr & 0x1f); @@ -98,7 +98,7 @@ return (old & mask) != 0; } -extern __inline__ int test_and_clear_bit(int nr, volatile void *addr) +static inline int test_and_clear_bit(int nr, volatile void *addr) { unsigned int old, t; unsigned int mask = 1 << (nr & 0x1f); @@ -117,7 +117,7 @@ return (old & mask) != 0; } -extern __inline__ int test_and_change_bit(int nr, volatile void *addr) +static inline int test_and_change_bit(int nr, volatile void *addr) { unsigned int old, t; unsigned int mask = 1 << (nr & 0x1f); @@ -138,7 +138,7 @@ #endif /* __INLINE_BITOPS */ /* Return the bit position of the most significant 1 bit in a word */ -extern __inline__ int __ilog2(unsigned int x) +static inline int __ilog2(unsigned int x) { int lz; @@ -146,14 +146,14 @@ return 31 - lz; } -extern __inline__ int ffz(unsigned int x) +static inline int ffz(unsigned int x) { if ((x = ~x) == 0) return 32; return __ilog2(x & -x); } -static __inline__ int __ffs(unsigned long x) +static inline int __ffs(unsigned long x) { return __ilog2(x & -x); } @@ -177,7 +177,7 @@ * the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -extern __inline__ int ffs(int x) +static inline int ffs(int x) { return __ilog2(x & -x) + 1; } diff --git a/arch/ppc/include/asm/io.h b/arch/ppc/include/asm/io.h index 98bf513..f83ab6e 100644 --- a/arch/ppc/include/asm/io.h +++ b/arch/ppc/include/asm/io.h @@ -136,7 +136,7 @@ /* * 8, 16 and 32 bit, big and little endian I/O operations, with barrier. */ -extern inline u8 in_8(const volatile u8 __iomem *addr) +static inline u8 in_8(const volatile u8 __iomem *addr) { u8 ret; @@ -145,12 +145,12 @@ return ret; } -extern inline void out_8(volatile u8 __iomem *addr, u8 val) +static inline void out_8(volatile u8 __iomem *addr, u8 val) { __asm__ __volatile__("sync;stb%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); } -extern inline u16 in_le16(const volatile u16 __iomem *addr) +static inline u16 in_le16(const volatile u16 __iomem *addr) { u16 ret; @@ -159,7 +159,7 @@ return ret; } -extern inline u16 in_be16(const volatile u16 __iomem *addr) +static inline u16 in_be16(const volatile u16 __iomem *addr) { u16 ret; @@ -168,18 +168,18 @@ return ret; } -extern inline void out_le16(volatile u16 __iomem *addr, u16 val) +static inline void out_le16(volatile u16 __iomem *addr, u16 val) { __asm__ __volatile__("sync; sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } -extern inline void out_be16(volatile u16 __iomem *addr, u16 val) +static inline void out_be16(volatile u16 __iomem *addr, u16 val) { __asm__ __volatile__("sync;sth%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); } -extern inline u32 in_le32(const volatile u32 __iomem *addr) +static inline u32 in_le32(const volatile u32 __iomem *addr) { u32 ret; @@ -188,7 +188,7 @@ return ret; } -extern inline u32 in_be32(const volatile u32 __iomem *addr) +static inline u32 in_be32(const volatile u32 __iomem *addr) { u32 ret; @@ -197,13 +197,13 @@ return ret; } -extern inline void out_le32(volatile u32 __iomem *addr, u32 val) +static inline void out_le32(volatile u32 __iomem *addr, u32 val) { __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } -extern inline void out_be32(volatile u32 __iomem *addr, u32 val) +static inline void out_be32(volatile u32 __iomem *addr, u32 val) { __asm__ __volatile__("sync;stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); } diff --git a/arch/ppc/include/asm/swab.h b/arch/ppc/include/asm/swab.h index c581e3e..110488e 100644 --- a/arch/ppc/include/asm/swab.h +++ b/arch/ppc/include/asm/swab.h @@ -19,7 +19,7 @@ #ifdef __KERNEL__ -static __inline__ __u16 ld_le16(const volatile __u16 *addr) +static inline __u16 ld_le16(const volatile __u16 *addr) { __u16 val; @@ -28,7 +28,7 @@ } #define __arch_swab16p ld_le16 -static __inline__ void st_le16(volatile __u16 *addr, const __u16 val) +static inline void st_le16(volatile __u16 *addr, const __u16 val) { __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } @@ -39,7 +39,7 @@ } #define __arch_swab16s __arch_swab16s -static __inline__ __u32 ld_le32(const volatile __u32 *addr) +static inline __u32 ld_le32(const volatile __u32 *addr) { __u32 val; @@ -48,7 +48,7 @@ } #define __arch_swab32p ld_le32 -static __inline__ void st_le32(volatile __u32 *addr, const __u32 val) +static inline void st_le32(volatile __u32 *addr, const __u32 val) { __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } diff --git a/arch/sandbox/include/asm/byteorder.h b/arch/sandbox/include/asm/byteorder.h index 37316f2..3d82bcb 100644 --- a/arch/sandbox/include/asm/byteorder.h +++ b/arch/sandbox/include/asm/byteorder.h @@ -1,8 +1,8 @@ -#ifndef _I386_BYTEORDER_H -#define _I386_BYTEORDER_H +#ifndef _SANDBOX_BYTEORDER_H +#define _SANDBOX_BYTEORDER_H #include #include -#endif /* _I386_BYTEORDER_H */ +#endif /* _SANDBOX_BYTEORDER_H */ diff --git a/commands/automount.c b/commands/automount.c index a29f286..b491d20 100644 --- a/commands/automount.c +++ b/commands/automount.c @@ -70,4 +70,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_PART) BAREBOX_CMD_HELP(cmd_automount_help) BAREBOX_CMD_END - diff --git a/commands/digest.c b/commands/digest.c index 340c07a..4cc615d 100644 --- a/commands/digest.c +++ b/commands/digest.c @@ -68,7 +68,7 @@ return ret; } -static void prints_algo_help(void) +static void __maybe_unused prints_algo_help(void) { puts("\navailable algo:\n"); digest_algo_prints("\t"); diff --git a/commands/export.c b/commands/export.c index 2e8bb49..4b4cf1e 100644 --- a/commands/export.c +++ b/commands/export.c @@ -59,4 +59,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_ENV) BAREBOX_CMD_HELP(cmd_export_help) BAREBOX_CMD_END - diff --git a/commands/false.c b/commands/false.c index 6ef9af3..90aa2cc 100644 --- a/commands/false.c +++ b/commands/false.c @@ -32,4 +32,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_SCRIPT) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END - diff --git a/commands/help.c b/commands/help.c index 6e61bde..3d36d9b 100644 --- a/commands/help.c +++ b/commands/help.c @@ -148,4 +148,3 @@ BAREBOX_CMD_HELP(cmd_help_help) BAREBOX_CMD_COMPLETE(command_complete) BAREBOX_CMD_END - diff --git a/commands/net.c b/commands/net.c index 7508c99..219c7ef 100644 --- a/commands/net.c +++ b/commands/net.c @@ -64,4 +64,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_NET) BAREBOX_CMD_COMPLETE(eth_complete) BAREBOX_CMD_END - diff --git a/commands/readline.c b/commands/readline.c index e537498..b6e0e3e 100644 --- a/commands/readline.c +++ b/commands/readline.c @@ -53,4 +53,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE) BAREBOX_CMD_HELP(cmd_readline_help) BAREBOX_CMD_END - diff --git a/commands/timeout.c b/commands/timeout.c index 2b99d4f..ef1a037 100644 --- a/commands/timeout.c +++ b/commands/timeout.c @@ -84,4 +84,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE) BAREBOX_CMD_HELP(cmd_timeout_help) BAREBOX_CMD_END - diff --git a/commands/trigger.c b/commands/trigger.c index b605448..2758ce7 100644 --- a/commands/trigger.c +++ b/commands/trigger.c @@ -105,4 +105,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) BAREBOX_CMD_HELP(cmd_trigger_help) BAREBOX_CMD_END - diff --git a/commands/true.c b/commands/true.c index fbb34e7..24dea46 100644 --- a/commands/true.c +++ b/commands/true.c @@ -32,4 +32,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_SCRIPT) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END - diff --git a/commands/ubi.c b/commands/ubi.c index 94da799..9463127 100644 --- a/commands/ubi.c +++ b/commands/ubi.c @@ -179,4 +179,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_PART) BAREBOX_CMD_HELP(cmd_ubirmvol_help) BAREBOX_CMD_END - diff --git a/commands/version.c b/commands/version.c index 898c719..090f2dd 100644 --- a/commands/version.c +++ b/commands/version.c @@ -33,4 +33,3 @@ BAREBOX_CMD_GROUP(CMD_GRP_INFO) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END - diff --git a/common/Kconfig b/common/Kconfig index 925fe4b..983d305 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -209,6 +209,16 @@ this will allow your bare_init to fit in SRAM as example ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE +config BAREBOX_MAX_PBLX_SIZE + depends on PBL_MULTI_IMAGES + depends on IMAGE_COMPRESSION + prompt "Maximum PBLX size" + hex + default 0xffffffff + help + Define the maximum size of the PBLX image. + The pblx is a self extracting barebox binary. + config HAVE_CONFIGURABLE_MEMORY_LAYOUT bool diff --git a/common/complete.c b/common/complete.c index 5b71f03..f0ef576 100644 --- a/common/complete.c +++ b/common/complete.c @@ -466,4 +466,3 @@ return reprint; } - diff --git a/common/kallsyms.c b/common/kallsyms.c index 53e22cd..e15dec5 100644 --- a/common/kallsyms.c +++ b/common/kallsyms.c @@ -212,4 +212,3 @@ return len; } EXPORT_SYMBOL_GPL(sprint_symbol); - diff --git a/common/parser.c b/common/parser.c index 4a48210..207599f 100644 --- a/common/parser.c +++ b/common/parser.c @@ -284,4 +284,3 @@ } return 0; } - diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig index 31f7d2d..ebd8da9 100644 --- a/drivers/mci/Kconfig +++ b/drivers/mci/Kconfig @@ -95,7 +95,7 @@ config MCI_PXA bool "PXA" - depends on ARCH_PXA + depends on ARCH_PXA2XX help Enable this entry to add support to read and write SD cards on a XScale PXA25x / PXA27x based system. diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c index 681dc93..8b8254c 100644 --- a/drivers/mtd/core.c +++ b/drivers/mtd/core.c @@ -542,7 +542,7 @@ return 0; } -int add_mtd_device(struct mtd_info *mtd, char *devname, int device_id) +int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id) { struct mtddev_hook *hook; int ret; diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index c941767..794c9db 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -148,14 +148,14 @@ { struct m25p *flash = nor->priv; - dev_dbg(nor->dev, "%dKiB at 0x%08x\n", - flash->mtd.erasesize / 1024, (u32)offset); + dev_dbg(nor->dev, "%dKiB at 0x%08x\n", + flash->mtd.erasesize / 1024, (u32)offset); - /* Set up command buffer. */ - flash->command[0] = nor->erase_opcode; - m25p_addr2cmd(nor, offset, flash->command); + /* Set up command buffer. */ + flash->command[0] = nor->erase_opcode; + m25p_addr2cmd(nor, offset, flash->command); - spi_write(flash->spi, flash->command, m25p_cmdsz(nor)); + spi_write(flash->spi, flash->command, m25p_cmdsz(nor)); return 0; } @@ -213,11 +213,11 @@ {"w25q128"}, {"w25q256"}, {"cat25c11"}, {"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"}, - /* - * Generic support for SPI NOR that can be identified by the JEDEC READ - * ID opcode (0x9F). Use this, if possible. - */ - {"nor-jedec"}, + /* + * Generic support for SPI NOR that can be identified by the JEDEC READ + * ID opcode (0x9F). Use this, if possible. + */ + {"nor-jedec"}, { }, }; @@ -233,7 +233,7 @@ struct m25p *flash; struct spi_nor *nor; enum read_mode mode = SPI_NOR_NORMAL; - char *flash_name = NULL; + const char *flash_name = NULL; int device_id; int ret; @@ -277,13 +277,10 @@ return ret; device_id = DEVICE_ID_SINGLE; - if (dev->device_node) { - const char *alias = of_alias_get(dev->device_node); - if (alias) - flash_name = xstrdup(alias); - } else if (data && data->name) { + if (dev->device_node) + flash_name = of_alias_get(dev->device_node); + else if (data && data->name) flash_name = data->name; - } if (!flash_name) { device_id = DEVICE_ID_DYNAMIC; diff --git a/drivers/mtd/mtd.h b/drivers/mtd/mtd.h index 414bd6c..2a85265 100644 --- a/drivers/mtd/mtd.h +++ b/drivers/mtd/mtd.h @@ -25,7 +25,7 @@ */ struct mtddev_hook { struct list_head hook; - int (*add_mtd_device)(struct mtd_info *mtd, char *devname, void **priv); + int (*add_mtd_device)(struct mtd_info *mtd, const char *devname, void **priv); int (*del_mtd_device)(struct mtd_info *mtd, void **priv); void *priv; }; diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c index 10d17e9..6160ddb 100644 --- a/drivers/mtd/mtdoob.c +++ b/drivers/mtd/mtdoob.c @@ -69,7 +69,7 @@ .lseek = dev_lseek_default, }; -static int add_mtdoob_device(struct mtd_info *mtd, char *devname, void **priv) +static int add_mtdoob_device(struct mtd_info *mtd, const char *devname, void **priv) { struct mtdoob *mtdoob; diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c index c25e406..ae4bec2 100644 --- a/drivers/mtd/mtdraw.c +++ b/drivers/mtd/mtdraw.c @@ -281,7 +281,7 @@ .lseek = dev_lseek_default, }; -static int add_mtdraw_device(struct mtd_info *mtd, char *devname, void **priv) +static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **priv) { struct mtdraw *mtdraw; diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c index 385a715..a186365 100644 --- a/drivers/net/altera_tse.c +++ b/drivers/net/altera_tse.c @@ -231,7 +231,7 @@ return 0; } -static int tse_set_ethaddr(struct eth_device *edev, unsigned char *m) +static int tse_set_ethaddr(struct eth_device *edev, const unsigned char *m) { struct altera_tse_priv *priv = edev->priv; struct alt_tse_mac *mac_dev = priv->tse_regs; diff --git a/drivers/net/ar231x.c b/drivers/net/ar231x.c index 48e4b30..7447c44 100644 --- a/drivers/net/ar231x.c +++ b/drivers/net/ar231x.c @@ -70,7 +70,7 @@ (*priv->reset_bit)(val, state); } -static int ar231x_set_ethaddr(struct eth_device *edev, unsigned char *addr); +static int ar231x_set_ethaddr(struct eth_device *edev, const unsigned char *addr); static void ar231x_reset_regs(struct eth_device *edev) { struct ar231x_eth_priv *priv = edev->priv; diff --git a/drivers/net/arc_emac.c b/drivers/net/arc_emac.c index 84e2c75..3dc54cd 100644 --- a/drivers/net/arc_emac.c +++ b/drivers/net/arc_emac.c @@ -332,7 +332,7 @@ return -1; } -static int arc_emac_set_ethaddr(struct eth_device *edev, unsigned char *mac) +static int arc_emac_set_ethaddr(struct eth_device *edev, const unsigned char *mac) { struct arc_emac_priv *priv = edev->priv; unsigned int addr_low, addr_hi; diff --git a/drivers/net/at91_ether.c b/drivers/net/at91_ether.c index 5a74837..523e355 100644 --- a/drivers/net/at91_ether.c +++ b/drivers/net/at91_ether.c @@ -261,7 +261,7 @@ return -1; } -static int at91_ether_set_ethaddr(struct eth_device *eth, unsigned char *adr) +static int at91_ether_set_ethaddr(struct eth_device *eth, const unsigned char *adr) { int i; diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index c0db96b..4d6b7b2 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -547,7 +547,7 @@ return -1; } -static int cpsw_set_hwaddr(struct eth_device *edev, unsigned char *mac) +static int cpsw_set_hwaddr(struct eth_device *edev, const unsigned char *mac) { struct cpsw_slave *slave = edev->priv; struct cpsw_priv *priv = slave->cpsw; diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index dccb808..a4a5dca 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -341,7 +341,7 @@ return 0; } -static int cs8900_set_ethaddr(struct eth_device *dev, unsigned char *mac) +static int cs8900_set_ethaddr(struct eth_device *dev, const unsigned char *mac) { struct cs8900_priv *priv = (struct cs8900_priv *)dev->priv; int i; diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 056ffe2..9f8f0e1 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -178,7 +178,7 @@ * This function must be called before emac_open() if you want to override * the default mac address. */ -static int davinci_emac_set_ethaddr(struct eth_device *edev, unsigned char *addr) +static int davinci_emac_set_ethaddr(struct eth_device *edev, const unsigned char *addr) { struct davinci_emac_priv *priv = edev->priv; int i; diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 213fe41..8006527 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -384,7 +384,7 @@ return -1; } -static int dwc_ether_set_ethaddr(struct eth_device *dev, u8 adr[6]) +static int dwc_ether_set_ethaddr(struct eth_device *dev, const unsigned char *adr) { struct dw_eth_dev *priv = dev->priv; struct eth_mac_regs *mac_p = priv->mac_regs_p; diff --git a/drivers/net/dm9k.c b/drivers/net/dm9k.c index c3c2a80..1f1938d 100644 --- a/drivers/net/dm9k.c +++ b/drivers/net/dm9k.c @@ -711,7 +711,7 @@ return 0; } -static int dm9k_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int dm9k_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { struct dm9k *priv = (struct dm9k *)edev->priv; int i, oft; diff --git a/drivers/net/ep93xx.c b/drivers/net/ep93xx.c index 4b73abf..90c12fc 100644 --- a/drivers/net/ep93xx.c +++ b/drivers/net/ep93xx.c @@ -466,7 +466,7 @@ } static int ep93xx_eth_set_ethaddr(struct eth_device *edev, - unsigned char *mac_addr) + const unsigned char *mac_addr) { struct mac_regs *regs = ep93xx_get_regs(edev); diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 7c52a09..6bae7d6 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -435,7 +435,7 @@ return 0; } -static int ethoc_set_ethaddr(struct eth_device *edev, unsigned char *mac) +static int ethoc_set_ethaddr(struct eth_device *edev, const unsigned char *mac) { struct ethoc *dev = edev->priv; diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c index 9a10c9f..78ccb85 100644 --- a/drivers/net/fec_imx.c +++ b/drivers/net/fec_imx.c @@ -249,7 +249,7 @@ return -1; } -static int fec_set_hwaddr(struct eth_device *dev, unsigned char *mac) +static int fec_set_hwaddr(struct eth_device *dev, const unsigned char *mac) { struct fec_priv *fec = (struct fec_priv *)dev->priv; diff --git a/drivers/net/fec_mpc5200.c b/drivers/net/fec_mpc5200.c index f431d79..14ef872 100644 --- a/drivers/net/fec_mpc5200.c +++ b/drivers/net/fec_mpc5200.c @@ -211,7 +211,7 @@ return -1; } -static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, unsigned char *mac) +static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, const unsigned char *mac) { mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv; uint8_t currByte; /* byte for which to compute the CRC */ diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 5e47c64..ac69833 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -233,7 +233,7 @@ return -ENODEV; } -static int gfar_set_ethaddr(struct eth_device *edev, unsigned char *mac) +static int gfar_set_ethaddr(struct eth_device *edev, const unsigned char *mac) { struct gfar_private *priv = edev->priv; void __iomem *regs = priv->regs; diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c index a8974cf..854a666 100644 --- a/drivers/net/ks8851_mll.c +++ b/drivers/net/ks8851_mll.c @@ -571,7 +571,7 @@ return 0; } -static int ks8851_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int ks8851_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { struct ks_net *priv = (struct ks_net *)edev->priv; diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 2ac00f3..6d4973f 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -493,7 +493,7 @@ return -1; } -static int macb_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int macb_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { struct macb_device *macb = edev->priv; diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 3be2ec5..aab52c4 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -486,7 +486,7 @@ return ret; } -static int mvneta_set_ethaddr(struct eth_device *edev, unsigned char *mac) +static int mvneta_set_ethaddr(struct eth_device *edev, const unsigned char *mac) { struct mvneta_port *priv = edev->priv; u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3]; diff --git a/drivers/net/netx_eth.c b/drivers/net/netx_eth.c index 96dbc7c..64e9886 100644 --- a/drivers/net/netx_eth.c +++ b/drivers/net/netx_eth.c @@ -210,7 +210,7 @@ return -1; } -static int netx_eth_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int netx_eth_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { struct netx_eth_priv *priv = (struct netx_eth_priv *)edev->priv; int xcno = priv->xcno; diff --git a/drivers/net/orion-gbe.c b/drivers/net/orion-gbe.c index 97ffff2..e6bd757 100644 --- a/drivers/net/orion-gbe.c +++ b/drivers/net/orion-gbe.c @@ -322,7 +322,7 @@ return ret; } -static int port_set_ethaddr(struct eth_device *edev, unsigned char *mac) +static int port_set_ethaddr(struct eth_device *edev, const unsigned char *mac) { struct port_priv *port = edev->priv; u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3]; diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index d57c706..a9eb865 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -352,7 +352,7 @@ } static int rtl8139_set_ethaddr(struct eth_device *edev, - unsigned char *mac_addr) + const unsigned char *mac_addr) { struct rtl8139_priv *priv = edev->priv; int i; diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index d6a7610..47d5e4a8 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -456,7 +456,7 @@ return 0; } -static int rtl8169_set_ethaddr(struct eth_device *edev, unsigned char *mac_addr) +static int rtl8169_set_ethaddr(struct eth_device *edev, const unsigned char *mac_addr) { struct rtl8169_priv *priv = edev->priv; int i; diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c index c0cf42a..5ea1bc3 100644 --- a/drivers/net/smc91111.c +++ b/drivers/net/smc91111.c @@ -1378,7 +1378,7 @@ } static int smc91c111_set_ethaddr(struct eth_device *edev, - unsigned char *mac_addr) + const unsigned char *mac_addr) { struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv; unsigned address; diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 9977ae3..60cf36e 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -182,7 +182,7 @@ return 0; } -static int smc911x_set_ethaddr(struct eth_device *edev, unsigned char *m) +static int smc911x_set_ethaddr(struct eth_device *edev, const unsigned char *m) { unsigned long addrh, addrl; @@ -630,8 +630,14 @@ return 0; } +static const struct of_device_id smsc911x_dt_ids[] = { + { .compatible = "smsc,lan9115", }, + { /* sentinel */ } +}; + static struct driver_d smc911x_driver = { .name = "smc911x", .probe = smc911x_probe, + .of_compatible = DRV_OF_COMPAT(smsc911x_dt_ids), }; device_platform_driver(smc911x_driver); diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 2458fb5..ca53f12 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -65,7 +65,7 @@ return -1; } -static int tap_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int tap_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { return 0; } diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 7cce5b9..4c53a14 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c @@ -403,7 +403,7 @@ return 0; } -static int asix_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int asix_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { /* not possible? */ return 0; diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 053da18..6360e48 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -363,7 +363,7 @@ return 0; } -static int smsc95xx_set_ethaddr(struct eth_device *edev, unsigned char *adr) +static int smsc95xx_set_ethaddr(struct eth_device *edev, const unsigned char *adr) { struct usbnet *udev = container_of(edev, struct usbnet, edev); diff --git a/drivers/net/xgmac.c b/drivers/net/xgmac.c index 3b2273f..7cc4d48 100644 --- a/drivers/net/xgmac.c +++ b/drivers/net/xgmac.c @@ -674,7 +674,7 @@ return 0; } -static int xgmac_set_ethaddr(struct eth_device *dev, unsigned char *addr) +static int xgmac_set_ethaddr(struct eth_device *dev, const unsigned char *addr) { struct xgmac_priv *priv = dev->priv; u32 data; diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 4d636c1..c186ad4 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -291,6 +291,7 @@ if (!IS_ENABLED(CONFIG_OFDEVICE)) return; + of_property_read_u32(np, "clock-frequency", &priv->plat.clock); of_property_read_u32(np, "reg-shift", &priv->plat.shift); } @@ -417,7 +418,7 @@ else ns16550_probe_dt(dev, priv); - if (!plat || !plat->clock) { + if (!priv->plat.clock) { priv->clk = clk_get(dev, NULL); if (IS_ERR(priv->clk)) { ret = PTR_ERR(priv->clk); @@ -427,12 +428,6 @@ priv->plat.clock = clk_get_rate(priv->clk); } - if (priv->plat.clock == 0 && IS_ENABLED(CONFIG_OFDEVICE)) { - struct device_node *np = dev->device_node; - - of_property_read_u32(np, "clock-frequency", &priv->plat.clock); - } - if (priv->plat.clock == 0) { dev_err(dev, "no valid clockrate\n"); ret = -EINVAL; diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5d9158f..13a3e70 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -25,7 +25,7 @@ config USB_GADGET_DRIVER_PXA27X bool prompt "PXA27x gadget driver" - depends on ARCH_PXA + depends on ARCH_PXA27X default y select USB_GADGET_DUALSPEED diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index fb92714..97f028a 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -481,4 +481,3 @@ } device_initcall(cramfs_init); - diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 6d7d262..ece937d 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -434,4 +434,3 @@ } coredevice_initcall(fat_init); - diff --git a/fs/ramfs.c b/fs/ramfs.c index fe5eb89..716f40f 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -644,4 +644,3 @@ } coredevice_initcall(ramfs_init); - diff --git a/images/Makefile b/images/Makefile index 587cb26..6ee1dcc 100644 --- a/images/Makefile +++ b/images/Makefile @@ -75,6 +75,8 @@ $(obj)/%.pblx: $(obj)/%.pblb $(obj)/barebox.z FORCE $(call if_changed,pblx,$(@F)) + $(call cmd,check_file_size,$@,$(CONFIG_BAREBOX_MAX_PBLX_SIZE)) + $(obj)/%.s: $(obj)/% FORCE $(call if_changed,disasm) diff --git a/include/digest.h b/include/digest.h index 7c6711b..3a9d305 100644 --- a/include/digest.h +++ b/include/digest.h @@ -59,6 +59,7 @@ /* * digest functions */ +#ifdef CONFIG_DIGEST int digest_algo_register(struct digest_algo *d); void digest_algo_unregister(struct digest_algo *d); void digest_algo_prints(const char *prefix); @@ -76,6 +77,16 @@ int digest_file_by_name(const char *algo, const char *filename, unsigned char *hash, const unsigned char *sig); +#else +static inline struct digest *digest_alloc(const char *name) +{ + return NULL; +} + +static inline void digest_free(struct digest *d) +{ +} +#endif static inline int digest_init(struct digest *d) { diff --git a/include/linux/bitops.h b/include/linux/bitops.h index be5fd38..f3a740c 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -54,7 +54,7 @@ (bit) < (size); \ (bit) = find_next_zero_bit((addr), (size), (bit) + 1)) -static __inline__ int get_bitmask_order(unsigned int count) +static inline int get_bitmask_order(unsigned int count) { int order; @@ -62,7 +62,7 @@ return order; /* We could be slightly more clever with -1 here... */ } -static __inline__ int get_count_order(unsigned int count) +static inline int get_count_order(unsigned int count) { int order; diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 33f1fd5..7e828bc 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -270,7 +270,7 @@ /* Kernel-side ioctl definitions */ -extern int add_mtd_device(struct mtd_info *mtd, char *devname, int device_id); +extern int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id); extern int del_mtd_device (struct mtd_info *mtd); extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); diff --git a/include/net.h b/include/net.h index 364011b..b93e264 100644 --- a/include/net.h +++ b/include/net.h @@ -42,7 +42,7 @@ int (*recv) (struct eth_device*); void (*halt) (struct eth_device*); int (*get_ethaddr) (struct eth_device*, u8 adr[6]); - int (*set_ethaddr) (struct eth_device*, u8 adr[6]); + int (*set_ethaddr) (struct eth_device*, const unsigned char *adr); struct eth_device *next; void *priv; @@ -60,6 +60,7 @@ IPaddr_t serverip; IPaddr_t netmask; IPaddr_t gateway; + char ethaddr_param[6]; char ethaddr[6]; }; @@ -67,6 +68,7 @@ int eth_register(struct eth_device* dev); /* Register network device */ void eth_unregister(struct eth_device* dev); /* Unregister network device */ +int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr); int eth_send(struct eth_device *edev, void *packet, int length); /* Send a packet */ int eth_rx(void); /* Check for received packets */ diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 1a5e8d0..0ab530d 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -218,4 +218,3 @@ # undef FOLD } - diff --git a/lib/gui/image_renderer.c b/lib/gui/image_renderer.c index dd29389..9bef99a 100644 --- a/lib/gui/image_renderer.c +++ b/lib/gui/image_renderer.c @@ -37,10 +37,10 @@ struct image *img; int ret; - data = read_file(file, &size); - if (!data) { - printf("unable to read %s\n", file); - return ERR_PTR(-ENOMEM); + ret = read_file_2(file, &size, &data, FILESIZE_MAX); + if (ret) { + printf("unable to read %s: %s\n", file, strerror(-ret)); + return ERR_PTR(ret); } ir = get_renderer(data, size); diff --git a/lib/libfile.c b/lib/libfile.c index 8acff04..ba03700 100644 --- a/lib/libfile.c +++ b/lib/libfile.c @@ -184,8 +184,8 @@ if (read_size < s.st_size) return -EFBIG; - else - return 0; + + return 0; err_out1: close(fd); diff --git a/lib/lzo/lzo1x_decompress_safe.c b/lib/lzo/lzo1x_decompress_safe.c index 3c0f512..6e8c822 100644 --- a/lib/lzo/lzo1x_decompress_safe.c +++ b/lib/lzo/lzo1x_decompress_safe.c @@ -258,4 +258,3 @@ } EXPORT_SYMBOL(lzo1x_decompress_safe); - diff --git a/lib/parameter.c b/lib/parameter.c index 865ad9f..60642f0 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -122,6 +122,14 @@ return p->value ? p->value : ""; } +static int compare(struct list_head *a, struct list_head *b) +{ + char *na = (char*)list_entry(a, struct param_d, list)->name; + char *nb = (char*)list_entry(b, struct param_d, list)->name; + + return strcmp(na, nb); +} + static int __dev_add_param(struct param_d *param, struct device_d *dev, const char *name, int (*set)(struct device_d *dev, struct param_d *p, const char *val), const char *(*get)(struct device_d *dev, struct param_d *p), @@ -145,7 +153,7 @@ param->flags = flags; param->dev = dev; - list_add_tail(¶m->list, &dev->parameters); + list_add_sort(¶m->list, &dev->parameters, compare); return 0; } @@ -575,7 +583,6 @@ return &piro->param; } -#ifdef CONFIG_NET struct param_ip { struct param_d param; IPaddr_t *ip; @@ -739,7 +746,6 @@ return &pm->param; } -#endif /** * dev_remove_param - remove a parameter from a device and free its diff --git a/lib/random.c b/lib/random.c index 14c7da1..210fea9 100644 --- a/lib/random.c +++ b/lib/random.c @@ -25,4 +25,3 @@ while (len--) *buf++ = rand() % 256; } - diff --git a/lib/strtox.c b/lib/strtox.c index 882865b..cfe6124 100644 --- a/lib/strtox.c +++ b/lib/strtox.c @@ -65,4 +65,3 @@ return result; } EXPORT_SYMBOL(simple_strtoull); - diff --git a/net/Makefile b/net/Makefile index 58bf143..8d564e7 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1,3 +1,4 @@ +obj-y += lib.o obj-$(CONFIG_NET) += eth.o obj-$(CONFIG_NET) += net.o obj-$(CONFIG_NET_NFS) += nfs.o diff --git a/net/eth.c b/net/eth.c index 0c1ff73..a090961 100644 --- a/net/eth.c +++ b/net/eth.c @@ -42,15 +42,27 @@ static LIST_HEAD(ethaddr_list); +int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr) +{ + int ret; + + ret = edev->set_ethaddr(edev, ethaddr); + if (ret) + return ret; + + memcpy(edev->ethaddr, ethaddr, ETH_ALEN); + + return 0; +} + static void register_preset_mac_address(struct eth_device *edev, const char *ethaddr) { unsigned char ethaddr_str[sizeof("xx:xx:xx:xx:xx:xx")]; - ethaddr_to_string(ethaddr, ethaddr_str); - if (is_valid_ether_addr(ethaddr)) { + ethaddr_to_string(ethaddr, ethaddr_str); dev_info(&edev->dev, "got preset MAC address: %s\n", ethaddr_str); - dev_set_param(&edev->dev, "ethaddr", ethaddr_str); + eth_set_ethaddr(edev, ethaddr); } } @@ -261,13 +273,11 @@ return 0; } -static int eth_set_ethaddr(struct param_d *param, void *priv) +static int eth_param_set_ethaddr(struct param_d *param, void *priv) { struct eth_device *edev = priv; - edev->set_ethaddr(edev, edev->ethaddr); - - return 0; + return eth_set_ethaddr(edev, edev->ethaddr_param); } #ifdef CONFIG_OFTREE @@ -350,7 +360,8 @@ dev_add_param_ip(dev, "serverip", NULL, NULL, &edev->serverip, edev); dev_add_param_ip(dev, "gateway", NULL, NULL, &edev->gateway, edev); dev_add_param_ip(dev, "netmask", NULL, NULL, &edev->netmask, edev); - dev_add_param_mac(dev, "ethaddr", eth_set_ethaddr, NULL, edev->ethaddr, edev); + dev_add_param_mac(dev, "ethaddr", eth_param_set_ethaddr, NULL, + edev->ethaddr_param, edev); if (edev->init) edev->init(edev); diff --git a/net/lib.c b/net/lib.c new file mode 100644 index 0000000..f1c60c9 --- /dev/null +++ b/net/lib.c @@ -0,0 +1,109 @@ +/* + * net.c - barebox networking support + * + * Copyright (c) 2015 Sascha Hauer , Pengutronix + * + * based on U-Boot (LiMon) code + * + * Copyright 1994 - 2000 Neil Russell. + * Copyright 2000 Roland Borde + * Copyright 2000 Paolo Scaffardi + * Copyright 2000-2002 Wolfgang Denk, wd@denx.de + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include + +int string_to_ethaddr(const char *str, u8 enetaddr[6]) +{ + int reg; + char *e; + + if (!str || strlen(str) != 17) { + memset(enetaddr, 0, 6); + return -EINVAL; + } + + if (str[2] != ':' || str[5] != ':' || str[8] != ':' || + str[11] != ':' || str[14] != ':') + return -EINVAL; + + for (reg = 0; reg < 6; ++reg) { + enetaddr[reg] = simple_strtoul(str, &e, 16); + str = e + 1; + } + + return 0; +} + +void ethaddr_to_string(const u8 enetaddr[6], char *str) +{ + sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", + enetaddr[0], enetaddr[1], enetaddr[2], enetaddr[3], + enetaddr[4], enetaddr[5]); +} + +void print_IPaddr(IPaddr_t x) +{ + puts(ip_to_string(x)); +} + +char *ip_to_string(IPaddr_t x) +{ + static char s[sizeof("xxx.xxx.xxx.xxx")]; + + x = ntohl(x); + sprintf(s, "%d.%d.%d.%d", + (int) ((x >> 24) & 0xff), + (int) ((x >> 16) & 0xff), + (int) ((x >> 8) & 0xff), (int) ((x >> 0) & 0xff) + ); + + return s; +} + +int string_to_ip(const char *s, IPaddr_t *ip) +{ + IPaddr_t addr = 0; + char *e; + int i; + + if (!s) + return -EINVAL; + + for (i = 0; i < 4; i++) { + unsigned long val; + + if (!isdigit(*s)) + return -EINVAL; + + val = simple_strtoul(s, &e, 10); + if (val > 255) + return -EINVAL; + + addr = (addr << 8) | val; + + if (*e != '.' && i != 3) + return -EINVAL; + + s = e + 1; + } + + *ip = htonl(addr); + + return 0; +} diff --git a/net/net.c b/net/net.c index 07350ad..e5bd9bb 100644 --- a/net/net.c +++ b/net/net.c @@ -62,50 +62,6 @@ return xsum & 0xffff; } -char *ip_to_string (IPaddr_t x) -{ - static char s[sizeof("xxx.xxx.xxx.xxx")]; - - x = ntohl (x); - sprintf (s, "%d.%d.%d.%d", - (int) ((x >> 24) & 0xff), - (int) ((x >> 16) & 0xff), - (int) ((x >> 8) & 0xff), (int) ((x >> 0) & 0xff) - ); - return s; -} - -int string_to_ip(const char *s, IPaddr_t *ip) -{ - IPaddr_t addr = 0; - char *e; - int i; - - if (!s) - return -EINVAL; - - for (i = 0; i < 4; i++) { - unsigned long val; - - if (!isdigit(*s)) - return -EINVAL; - - val = simple_strtoul(s, &e, 10); - if (val > 255) - return -EINVAL; - - addr = (addr << 8) | val; - - if (*e != '.' && i != 3) - return -EINVAL; - - s = e + 1; - } - - *ip = htonl(addr); - return 0; -} - IPaddr_t getenv_ip(const char *name) { IPaddr_t ip; @@ -131,40 +87,6 @@ return 0; } -void print_IPaddr (IPaddr_t x) -{ - puts(ip_to_string(x)); -} - -int string_to_ethaddr(const char *str, u8 enetaddr[6]) -{ - int reg; - char *e; - - if (!str || strlen(str) != 17) { - memset(enetaddr, 0, 6); - return -EINVAL; - } - - if (str[2] != ':' || str[5] != ':' || str[8] != ':' || - str[11] != ':' || str[14] != ':') - return -EINVAL; - - for (reg = 0; reg < 6; ++reg) { - enetaddr[reg] = simple_strtoul (str, &e, 16); - str = e + 1; - } - - return 0; -} - -void ethaddr_to_string(const u8 enetaddr[6], char *str) -{ - sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", - enetaddr[0], enetaddr[1], enetaddr[2], enetaddr[3], - enetaddr[4], enetaddr[5]); -} - static unsigned char *arp_ether; static IPaddr_t arp_wait_ip; @@ -348,7 +270,7 @@ random_ether_addr(edev->ethaddr); ethaddr_to_string(edev->ethaddr, str); printf("warning: No MAC address set. Using random address %s\n", str); - dev_set_param(&edev->dev, "ethaddr", str); + eth_set_ethaddr(edev, edev->ethaddr); } /* If we don't have an ip only broadcast is allowed */ @@ -667,4 +589,3 @@ } postcore_initcall(net_init); - diff --git a/net/nfs.c b/net/nfs.c index 2753330..0a30219 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -731,4 +731,3 @@ BAREBOX_CMD_OPTS("FILE [LOCALFILE]") BAREBOX_CMD_GROUP(CMD_GRP_NET) BAREBOX_CMD_END -