* Patches for -next @ 2010-01-25 7:32 Sascha Hauer 2010-01-25 7:32 ` [PATCH 01/12] remove unused cdp code Sascha Hauer 2010-01-25 7:39 ` Patches for -next Sascha Hauer 0 siblings, 2 replies; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Hi all, Here are some patches to review for -next Sascha _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 01/12] remove unused cdp code 2010-01-25 7:32 Patches for -next Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 02/12] remove obsolete comment Sascha Hauer 2010-01-25 7:39 ` Patches for -next Sascha Hauer 1 sibling, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- commands/net.c | 48 ------------------------------------------------ include/net.h | 8 -------- 2 files changed, 0 insertions(+), 56 deletions(-) diff --git a/commands/net.c b/commands/net.c index df06227..902c8bb 100644 --- a/commands/net.c +++ b/commands/net.c @@ -210,54 +210,6 @@ out: return rcode; } -#ifdef CONFIG_NET_CDP - -static void cdp_update_env(void) -{ - char tmp[16]; - - if (CDPApplianceVLAN != htons(-1)) { - printf("CDP offered appliance VLAN %d\n", ntohs(CDPApplianceVLAN)); - VLAN_to_string(CDPApplianceVLAN, tmp); - setenv("vlan", tmp); - NetOurVLAN = CDPApplianceVLAN; - } - - if (CDPNativeVLAN != htons(-1)) { - printf("CDP offered native VLAN %d\n", ntohs(CDPNativeVLAN)); - VLAN_to_string(CDPNativeVLAN, tmp); - setenv("nvlan", tmp); - NetOurNativeVLAN = CDPNativeVLAN; - } - -} - -static int do_cdp (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - int r; - - if (NetLoopInit(CDP) < 0) - return 1; - - r = NetLoop(); - if (r < 0) { - printf("cdp failed; perhaps not a CISCO switch?\n"); - return 1; - } - - cdp_update_env(); - - return 0; -} - -BAREBOX_CMD_START(cdp) - .cmd = do_cdp, - .usage = "Perform CDP network configuration", - BAREBOX_CMD_HELP("[loadAddress] [host ip addr:bootfilename]\n") -BAREBOX_CMD_END - -#endif /* CONFIG_NET_CDP */ - static int do_ethact (cmd_tbl_t *cmdtp, int argc, char *argv[]) { struct eth_device *edev; diff --git a/include/net.h b/include/net.h index c689a43..7353c8f 100644 --- a/include/net.h +++ b/include/net.h @@ -279,10 +279,6 @@ extern uchar NetEtherNullAddr[6]; extern ushort NetOurVLAN; /* Our VLAN */ extern ushort NetOurNativeVLAN; /* Our Native VLAN */ -extern uchar NetCDPAddr[6]; /* Ethernet CDP address */ -extern ushort CDPNativeVLAN; /* CDP returned native VLAN */ -extern ushort CDPApplianceVLAN; /* CDP returned appliance VLAN */ - extern int NetState; /* Network loop state */ /* ---------- Added by sha ------------ */ @@ -301,10 +297,6 @@ extern void ArpRequest (void); typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP } proto_t; -/* when CDP completes these hold the return values */ -extern ushort CDPNativeVLAN; -extern ushort CDPApplianceVLAN; - /* Initialize the network adapter */ int NetLoopInit(proto_t); -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 02/12] remove obsolete comment 2010-01-25 7:32 ` [PATCH 01/12] remove unused cdp code Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 03/12] cache functions from kernel Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- include/command.h | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/include/command.h b/include/command.h index f103045..393438d 100644 --- a/include/command.h +++ b/include/command.h @@ -79,11 +79,6 @@ void barebox_cmd_usage(cmd_tbl_t *cmdtp); #endif /* __ASSEMBLY__ */ -/* - * Configurable monitor commands definitions have been moved - * to include/cmd_confdefs.h - */ - #define __stringify_1(x) #x #define __stringify(x) __stringify_1(x) -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 03/12] cache functions from kernel 2010-01-25 7:32 ` [PATCH 02/12] remove obsolete comment Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 04/12] remove unused NETCONSOLE stuff Sascha Hauer 2010-01-25 8:57 ` [PATCH 03/12] cache functions from kernel Uwe Kleine-König 0 siblings, 2 replies; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/cpu/Makefile | 6 +- arch/arm/cpu/cache-armv4.S | 137 ++++++++++++++++++++++++++++++++ arch/arm/cpu/cache-armv6.S | 131 +++++++++++++++++++++++++++++++ arch/arm/cpu/cache-armv7.S | 185 ++++++++++++++++++++++++++++++++++++++++++++ arch/arm/cpu/mmu.c | 29 ++------ 5 files changed, 463 insertions(+), 25 deletions(-) create mode 100644 arch/arm/cpu/cache-armv4.S create mode 100644 arch/arm/cpu/cache-armv6.S create mode 100644 arch/arm/cpu/cache-armv7.S diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile index 538ab57..2273e45 100644 --- a/arch/arm/cpu/Makefile +++ b/arch/arm/cpu/Makefile @@ -11,5 +11,7 @@ obj-$(CONFIG_ARCH_IMX31) += start-arm.o obj-$(CONFIG_ARCH_IMX35) += start-arm.o obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o obj-$(CONFIG_MMU) += mmu.o -obj-$(CONFIG_MMU) += cache.o - +obj-$(CONFIG_CPU_32v4T) += cache-armv4.o +obj-$(CONFIG_CPU_32v5) += cache-armv4.o +obj-$(CONFIG_CPU_32v6) += cache-armv6.o +obj-$(CONFIG_CPU_32v7) += cache-armv7.o diff --git a/arch/arm/cpu/cache-armv4.S b/arch/arm/cpu/cache-armv4.S new file mode 100644 index 0000000..a0ab256 --- /dev/null +++ b/arch/arm/cpu/cache-armv4.S @@ -0,0 +1,137 @@ +#include <linux/linkage.h> + +#define CACHE_DLINESIZE 32 + +ENTRY(__mmu_cache_on) + mov r12, lr +#ifdef CONFIG_MMU + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs + mrc p15, 0, r0, c1, c0, 0 @ read control reg + orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement + orr r0, r0, #0x0030 +#ifdef CONFIG_CPU_ENDIAN_BE8 + orr r0, r0, #1 << 25 @ big-endian page tables +#endif + bl __common_mmu_cache_on + mov r0, #0 + mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs +#endif + mov pc, r12 +ENDPROC(__mmu_cache_on) + +__common_mmu_cache_on: + orr r0, r0, #0x000d @ Write buffer, mmu + b 1f + .align 5 @ cache line aligned +1: mcr p15, 0, r0, c1, c0, 0 @ load control register + mrc p15, 0, r0, c1, c0, 0 @ and read it back to + sub pc, lr, r0, lsr #32 @ properly flush pipeline + +ENTRY(__mmu_cache_off) +#ifdef CONFIG_MMU + mrc p15, 0, r0, c1, c0 + bic r0, r0, #0x000d + mcr p15, 0, r0, c1, c0 @ turn MMU and cache off + mov r0, #0 + mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4 + mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4 +#endif + mov pc, lr +ENDPROC(__mmu_cache_off) + +ENTRY(__mmu_cache_flush) + mrc p15, 0, r6, c0, c0 @ get processor ID + mov r2, #64*1024 @ default: 32K dcache size (*2) + mov r11, #32 @ default: 32 byte line size + mrc p15, 0, r3, c0, c0, 1 @ read cache type + teq r3, r6 @ cache ID register present? + beq no_cache_id + mov r1, r3, lsr #18 + and r1, r1, #7 + mov r2, #1024 + mov r2, r2, lsl r1 @ base dcache size *2 + tst r3, #1 << 14 @ test M bit + addne r2, r2, r2, lsr #1 @ +1/2 size if M == 1 + mov r3, r3, lsr #12 + and r3, r3, #3 + mov r11, #8 + mov r11, r11, lsl r3 @ cache line size in bytes +no_cache_id: + mov r1, pc + bic r1, r1, #63 @ align to longest cache line + add r2, r1, r2 +1: + ldr r3, [r1], r11 @ s/w flush D cache + teq r1, r2 + bne 1b + + mcr p15, 0, r1, c7, c5, 0 @ flush I cache + mcr p15, 0, r1, c7, c6, 0 @ flush D cache + mcr p15, 0, r1, c7, c10, 4 @ drain WB + mov pc, lr +ENDPROC(__mmu_cache_flush) + +/* + * dma_inv_range(start, end) + * + * Invalidate (discard) the specified virtual address range. + * May not write back any entries. If 'start' or 'end' + * are not cache line aligned, those lines must be written + * back. + * + * - start - virtual start address + * - end - virtual end address + * + * (same as v4wb) + */ +ENTRY(dma_inv_range) + tst r0, #CACHE_DLINESIZE - 1 + bic r0, r0, #CACHE_DLINESIZE - 1 + mcrne p15, 0, r0, c7, c10, 1 @ clean D entry + tst r1, #CACHE_DLINESIZE - 1 + mcrne p15, 0, r1, c7, c10, 1 @ clean D entry +1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry + add r0, r0, #CACHE_DLINESIZE + cmp r0, r1 + blo 1b + mcr p15, 0, r0, c7, c10, 4 @ drain WB + mov pc, lr + +/* + * dma_clean_range(start, end) + * + * Clean the specified virtual address range. + * + * - start - virtual start address + * - end - virtual end address + * + * (same as v4wb) + */ +ENTRY(dma_clean_range) + bic r0, r0, #CACHE_DLINESIZE - 1 +1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry + add r0, r0, #CACHE_DLINESIZE + cmp r0, r1 + blo 1b + mcr p15, 0, r0, c7, c10, 4 @ drain WB + mov pc, lr + +/* + * dma_flush_range(start, end) + * + * Clean and invalidate the specified virtual address range. + * + * - start - virtual start address + * - end - virtual end address + */ +ENTRY(dma_flush_range) + bic r0, r0, #CACHE_DLINESIZE - 1 +1: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry + add r0, r0, #CACHE_DLINESIZE + cmp r0, r1 + blo 1b + mcr p15, 0, r0, c7, c10, 4 @ drain WB + mov pc, lr + diff --git a/arch/arm/cpu/cache-armv6.S b/arch/arm/cpu/cache-armv6.S new file mode 100644 index 0000000..ceabd52 --- /dev/null +++ b/arch/arm/cpu/cache-armv6.S @@ -0,0 +1,131 @@ +#include <linux/linkage.h> + +#define HARVARD_CACHE +#define CACHE_LINE_SIZE 32 +#define D_CACHE_LINE_SIZE 32 + +ENTRY(__mmu_cache_on) + mov r12, lr +#ifdef CONFIG_MMU + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs + mrc p15, 0, r0, c1, c0, 0 @ read control reg + orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement + orr r0, r0, #0x0030 +#ifdef CONFIG_CPU_ENDIAN_BE8 + orr r0, r0, #1 << 25 @ big-endian page tables +#endif + bl __common_mmu_cache_on + mov r0, #0 + mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs +#endif + mov pc, r12 +ENDPROC(__mmu_cache_on) + +__common_mmu_cache_on: + orr r0, r0, #0x000d @ Write buffer, mmu + b 1f + .align 5 @ cache line aligned +1: mcr p15, 0, r0, c1, c0, 0 @ load control register + mrc p15, 0, r0, c1, c0, 0 @ and read it back to + sub pc, lr, r0, lsr #32 @ properly flush pipeline + +ENTRY(__mmu_cache_off) +#ifdef CONFIG_MMU + mrc p15, 0, r0, c1, c0 + bic r0, r0, #0x000d + mcr p15, 0, r0, c1, c0 @ turn MMU and cache off + mov r0, #0 + mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4 + mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4 +#endif + mov pc, lr + +ENTRY(__mmu_cache_flush) + mov r1, #0 + mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D + mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB + mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified + mcr p15, 0, r1, c7, c10, 4 @ drain WB + mov pc, lr +ENDPROC(__mmu_cache_flush) + +/* + * v6_dma_inv_range(start,end) + * + * Invalidate the data cache within the specified region; we will + * be performing a DMA operation in this region and we want to + * purge old data in the cache. + * + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_inv_range) + tst r0, #D_CACHE_LINE_SIZE - 1 + bic r0, r0, #D_CACHE_LINE_SIZE - 1 +#ifdef HARVARD_CACHE + mcrne p15, 0, r0, c7, c10, 1 @ clean D line +#else + mcrne p15, 0, r0, c7, c11, 1 @ clean unified line +#endif + tst r1, #D_CACHE_LINE_SIZE - 1 + bic r1, r1, #D_CACHE_LINE_SIZE - 1 +#ifdef HARVARD_CACHE + mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line +#else + mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line +#endif +1: +#ifdef HARVARD_CACHE + mcr p15, 0, r0, c7, c6, 1 @ invalidate D line +#else + mcr p15, 0, r0, c7, c7, 1 @ invalidate unified line +#endif + add r0, r0, #D_CACHE_LINE_SIZE + cmp r0, r1 + blo 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mov pc, lr + +/* + * v6_dma_clean_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_clean_range) + bic r0, r0, #D_CACHE_LINE_SIZE - 1 +1: +#ifdef HARVARD_CACHE + mcr p15, 0, r0, c7, c10, 1 @ clean D line +#else + mcr p15, 0, r0, c7, c11, 1 @ clean unified line +#endif + add r0, r0, #D_CACHE_LINE_SIZE + cmp r0, r1 + blo 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mov pc, lr + +/* + * v6_dma_flush_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_flush_range) + bic r0, r0, #D_CACHE_LINE_SIZE - 1 +1: +#ifdef HARVARD_CACHE + mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line +#else + mcr p15, 0, r0, c7, c15, 1 @ clean & invalidate line +#endif + add r0, r0, #D_CACHE_LINE_SIZE + cmp r0, r1 + blo 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mov pc, lr + diff --git a/arch/arm/cpu/cache-armv7.S b/arch/arm/cpu/cache-armv7.S new file mode 100644 index 0000000..b370acd --- /dev/null +++ b/arch/arm/cpu/cache-armv7.S @@ -0,0 +1,185 @@ +#include <linux/linkage.h> + +ENTRY(__mmu_cache_on) + mov r12, lr +#ifdef CONFIG_MMU + mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0 + tst r11, #0xf @ VMSA + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + tst r11, #0xf @ VMSA + mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs +#endif + mrc p15, 0, r0, c1, c0, 0 @ read control reg + orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement + orr r0, r0, #0x003c @ write buffer +#ifdef CONFIG_MMU +#ifdef CONFIG_CPU_ENDIAN_BE8 + orr r0, r0, #1 << 25 @ big-endian page tables +#endif + orrne r0, r0, #1 @ MMU enabled + movne r1, #-1 + mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer + mcrne p15, 0, r1, c3, c0, 0 @ load domain access control +#endif + mcr p15, 0, r0, c1, c0, 0 @ load control register + mrc p15, 0, r0, c1, c0, 0 @ and read it back + mov r0, #0 + mcr p15, 0, r0, c7, c5, 4 @ ISB + mov pc, r12 +ENDPROC(__mmu_cache_on) + +ENTRY(__mmu_cache_off) + mrc p15, 0, r0, c1, c0 +#ifdef CONFIG_MMU + bic r0, r0, #0x000d +#else + bic r0, r0, #0x000c +#endif + mcr p15, 0, r0, c1, c0 @ turn MMU and cache off + mov r12, lr + bl __mmu_cache_flush + mov r0, #0 +#ifdef CONFIG_MMU + mcr p15, 0, r0, c8, c7, 0 @ invalidate whole TLB +#endif + mcr p15, 0, r0, c7, c5, 6 @ invalidate BTC + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB + mov pc, r12 +ENDPROC(__mmu_cache_on) + +ENTRY(__mmu_cache_flush) + mrc p15, 0, r10, c0, c1, 5 @ read ID_MMFR1 + tst r10, #0xf << 16 @ hierarchical cache (ARMv7) + mov r10, #0 + beq hierarchical + mcr p15, 0, r10, c7, c14, 0 @ clean+invalidate D + b iflush +hierarchical: + mcr p15, 0, r10, c7, c10, 5 @ DMB + stmfd sp!, {r0-r7, r9-r11} + mrc p15, 1, r0, c0, c0, 1 @ read clidr + ands r3, r0, #0x7000000 @ extract loc from clidr + mov r3, r3, lsr #23 @ left align loc bit field + beq finished @ if loc is 0, then no need to clean + mov r10, #0 @ start clean at cache level 0 +loop1: + add r2, r10, r10, lsr #1 @ work out 3x current cache level + mov r1, r0, lsr r2 @ extract cache type bits from clidr + and r1, r1, #7 @ mask of the bits for current cache only + cmp r1, #2 @ see what cache we have at this level + blt skip @ skip if no cache, or just i-cache + mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr + mcr p15, 0, r10, c7, c5, 4 @ isb to sych the new cssr&csidr + mrc p15, 1, r1, c0, c0, 0 @ read the new csidr + and r2, r1, #7 @ extract the length of the cache lines + add r2, r2, #4 @ add 4 (line length offset) + ldr r4, =0x3ff + ands r4, r4, r1, lsr #3 @ find maximum number on the way size + clz r5, r4 @ find bit position of way size increment + ldr r7, =0x7fff + ands r7, r7, r1, lsr #13 @ extract max number of the index size +loop2: + mov r9, r4 @ create working copy of max way size +loop3: + orr r11, r10, r9, lsl r5 @ factor way and cache number into r11 + orr r11, r11, r7, lsl r2 @ factor index number into r11 + mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way + subs r9, r9, #1 @ decrement the way + bge loop3 + subs r7, r7, #1 @ decrement the index + bge loop2 +skip: + add r10, r10, #2 @ increment cache number + cmp r3, r10 + bgt loop1 +finished: + ldmfd sp!, {r0-r7, r9-r11} + mov r10, #0 @ swith back to cache level 0 + mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr +iflush: + mcr p15, 0, r10, c7, c10, 4 @ DSB + mcr p15, 0, r10, c7, c5, 0 @ invalidate I+BTB + mcr p15, 0, r10, c7, c10, 4 @ DSB + mcr p15, 0, r10, c7, c5, 4 @ ISB + mov pc, lr +ENDPROC(__mmu_cache_flush) + +/* + * cache_line_size - get the cache line size from the CSIDR register + * (available on ARMv7+). It assumes that the CSSR register was configured + * to access the L1 data cache CSIDR. + */ + .macro dcache_line_size, reg, tmp + mrc p15, 1, \tmp, c0, c0, 0 @ read CSIDR + and \tmp, \tmp, #7 @ cache line size encoding + mov \reg, #16 @ size offset + mov \reg, \reg, lsl \tmp @ actual cache line size + .endm + +/* + * v7_dma_inv_range(start,end) + * + * Invalidate the data cache within the specified region; we will + * be performing a DMA operation in this region and we want to + * purge old data in the cache. + * + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_inv_range) + dcache_line_size r2, r3 + sub r3, r2, #1 + tst r0, r3 + bic r0, r0, r3 + mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line + + tst r1, r3 + bic r1, r1, r3 + mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D / U line +1: + mcr p15, 0, r0, c7, c6, 1 @ invalidate D / U line + add r0, r0, r2 + cmp r0, r1 + blo 1b + dsb + mov pc, lr +ENDPROC(dma_inv_range) + +/* + * v7_dma_clean_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_clean_range) + dcache_line_size r2, r3 + sub r3, r2, #1 + bic r0, r0, r3 +1: + mcr p15, 0, r0, c7, c10, 1 @ clean D / U line + add r0, r0, r2 + cmp r0, r1 + blo 1b + dsb + mov pc, lr +ENDPROC(dma_clean_range) + +/* + * v7_dma_flush_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +ENTRY(dma_flush_range) + dcache_line_size r2, r3 + sub r3, r2, #1 + bic r0, r0, r3 +1: + mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line + add r0, r0, r2 + cmp r0, r1 + blo 1b + dsb + mov pc, lr +ENDPROC(dma_flush_range) + diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 9e00927..fff7ddf 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -53,12 +53,10 @@ void mmu_init(void) void mmu_enable(void) { asm volatile ( - "mrc p15, 0, r1, c1, c0, 0;" - "orr r1, r1, #0x0007;" /* enable MMU + Dcache */ - "mcr p15, 0, r1, c1, c0, 0" + "bl __mmu_cache_on;" : : - : "r1" /* Clobber list */ + : "r0", "r1", "r2", "r3", "r6", "r10", "r12" ); } @@ -67,28 +65,13 @@ void mmu_enable(void) */ void mmu_disable(void) { + asm volatile ( - "nop; " - "nop; " - "nop; " - "nop; " - "nop; " - "nop; " - /* test, clean and invalidate cache */ - "1: mrc p15, 0, r15, c7, c14, 3;" - " bne 1b;" - " mov pc, lr;" - " mov r0, #0x0;" - " mcr p15, 0, r0, c7, c10, 4;" /* drain the write buffer */ - " mcr p15, 0, r1, c7, c6, 0;" /* clear data cache */ - " mrc p15, 0, r1, c1, c0, 0;" - " bic r1, r1, #0x0007;" /* disable MMU + DCache */ - " mcr p15, 0, r1, c1, c0, 0;" - " mcr p15, 0, r0, c7, c6, 0;" /* flush d-cache */ - " mcr p15, 0, r0, c8, c7, 0;" /* flush i+d-TLBs */ + "bl __mmu_cache_flush;" + "bl __mmu_cache_off;" : : - : "r0" /* Clobber list */ + : "r0", "r1", "r2", "r3", "r6", "r10", "r12" ); } -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 04/12] remove unused NETCONSOLE stuff 2010-01-25 7:32 ` [PATCH 03/12] cache functions from kernel Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 05/12] remove unused file common/flash.c Sascha Hauer 2010-01-25 8:57 ` [PATCH 03/12] cache functions from kernel Uwe Kleine-König 1 sibling, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- net/net.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/net/net.c b/net/net.c index 214685c..9818f42 100644 --- a/net/net.c +++ b/net/net.c @@ -576,9 +576,6 @@ NetReceive(uchar * inpkt, int len) /* save address for later use */ memcpy(NetArpWaitPacketMAC, &arp->ar_data[0], 6); -#ifdef CONFIG_NETCONSOLE - (*packetHandler)(0,0,0,0); -#endif /* modify header, and transmit it */ memcpy(((Ethernet_t *)NetArpWaitTxPacket)->et_dest, NetArpWaitPacketMAC, 6); (void) eth_send(NetArpWaitTxPacket, NetArpWaitTxPacketSize); @@ -737,13 +734,6 @@ NetReceive(uchar * inpkt, int len) } } #endif - -#ifdef CONFIG_NETCONSOLE - nc_input_packet((uchar *)ip +IP_HDR_SIZE, - ntohs(ip->udp_dst), - ntohs(ip->udp_src), - ntohs(ip->udp_len) - 8); -#endif /* * IP header OK. Pass the packet to the current handler. */ -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 05/12] remove unused file common/flash.c 2010-01-25 7:32 ` [PATCH 04/12] remove unused NETCONSOLE stuff Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 06/12] Move tftp/nfs specific code to net/* Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- common/flash.c | 73 -------------------------------------------------------- 1 files changed, 0 insertions(+), 73 deletions(-) delete mode 100644 common/flash.c diff --git a/common/flash.c b/common/flash.c deleted file mode 100644 index 4e3d9a3..0000000 --- a/common/flash.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (C) Copyright 2000 - * Wolfgang Denk, DENX Software Engineering, 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 as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -/* #define DEBUG */ - -#include <common.h> -#include <command.h> -#include <cfi_flash.h> - -extern flash_info_t flash_info[]; /* info for FLASH chips */ - -flash_info_t * -addr2info (ulong addr) -{ - printf("%s is broken\n",__FUNCTION__); - - return (NULL); -} - -void flash_perror (int err) -{ - switch (err) { - case ERR_OK: - break; - case ERR_TIMOUT: - puts ("Timeout writing to Flash\n"); - break; - case ERR_NOT_ERASED: - puts ("Flash not Erased\n"); - break; - case ERR_PROTECTED: - puts ("Can't write to protected Flash sectors\n"); - break; - case ERR_INVAL: - puts ("Outside available Flash\n"); - break; - case ERR_ALIGN: - puts ("Start and/or end address not on sector boundary\n"); - break; - case ERR_UNKNOWN_FLASH_VENDOR: - puts ("Unknown Vendor of Flash\n"); - break; - case ERR_UNKNOWN_FLASH_TYPE: - puts ("Unknown Type of Flash\n"); - break; - case ERR_PROG_ERROR: - puts ("General Flash Programming Error\n"); - break; - default: - printf ("%s[%d] FIXME: rc=%d\n", __FILE__, __LINE__, err); - break; - } -} -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 06/12] Move tftp/nfs specific code to net/* 2010-01-25 7:32 ` [PATCH 05/12] remove unused file common/flash.c Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 07/12] remove typedef cmd_tbl_t and replace it with struct command Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox This adds a few bytes of binary space but is done to put the code where it belongs to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- commands/net.c | 108 -------------------------------------------------------- net/nfs.c | 56 ++++++++++++++++++++++++++++- net/tftp.c | 72 ++++++++++++++++++++++++++++++++++++- 3 files changed, 126 insertions(+), 110 deletions(-) diff --git a/commands/net.c b/commands/net.c index 902c8bb..5fa49cf 100644 --- a/commands/net.c +++ b/commands/net.c @@ -32,12 +32,8 @@ #include <driver.h> #include <net.h> #include <fs.h> -#include <fcntl.h> #include <errno.h> #include <libbb.h> -#include <libgen.h> - -static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]); void netboot_update_env(void) { @@ -77,37 +73,6 @@ void netboot_update_env(void) setenv ("domain", NetOurNISDomain); } -static int do_tftpb (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - return netboot_common (TFTP, cmdtp, argc, argv); -} - -static const __maybe_unused char cmd_tftp_help[] = -"Usage: tftp <file> [localfile]\n" -"Load a file via network using BootP/TFTP protocol.\n"; - -BAREBOX_CMD_START(tftp) - .cmd = do_tftpb, - .usage = "Load file using tftp protocol", - BAREBOX_CMD_HELP(cmd_tftp_help) -BAREBOX_CMD_END - -/** - * @page tftp_command tftp - * - * Usage is: tftp \<filename\> [\<localfilename\>] - * - * Load a file via network using BootP/TFTP protocol. The loaded file you - * can find after download in you current ramdisk. Refer \b ls command. - * - * \<localfile> can be the local filename only, or also a device name. In the - * case of a device name, the will gets stored there. This works also for - * partitions of flash memory. Refer \b erase, \b unprotect for flash - * preparation. - * - * Note: This command is available only, if enabled in the menuconfig. - */ - #ifdef CONFIG_NET_RARP extern void RarpRequest(void); @@ -137,79 +102,6 @@ BAREBOX_CMD_START(rarpboot) BAREBOX_CMD_END #endif /* CONFIG_NET_RARP */ -#ifdef CONFIG_NET_NFS -static int do_nfs (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - return netboot_common(NFS, cmdtp, argc, argv); -} - -static const __maybe_unused char cmd_nfs_help[] = -"Usage: nfs <file> [localfile]\n" -"Load a file via network using nfs protocol.\n"; - -BAREBOX_CMD_START(nfs) - .cmd = do_nfs, - .usage = "boot image via network using nfs protocol", - BAREBOX_CMD_HELP(cmd_nfs_help) -BAREBOX_CMD_END - -#endif /* CONFIG_NET_NFS */ - -int net_store_fd; - -extern void TftpStart(char *); /* Begin TFTP get */ -extern void NfsStart(char *); - -static int -netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - int rcode = 0; - int size; - char *localfile; - char *remotefile; - - if (argc < 2) - return COMMAND_ERROR_USAGE; - - remotefile = argv[1]; - - if (argc == 2) - localfile = basename(remotefile); - else - localfile = argv[2]; - - net_store_fd = open(localfile, O_WRONLY | O_CREAT); - if (net_store_fd < 0) { - perror("open"); - return 1; - } - - if (NetLoopInit(proto) < 0) - goto out; - - switch (proto) { - case TFTP: - TftpStart(remotefile); - break; - case NFS: - NfsStart(remotefile); - default: - break; - } - - if ((size = NetLoop()) < 0) { - rcode = size; - goto out; - } - - /* NetLoop ok, update environment */ - netboot_update_env(); - -out: - close(net_store_fd); - return rcode; -} - static int do_ethact (cmd_tbl_t *cmdtp, int argc, char *argv[]) { struct eth_device *edev; diff --git a/net/nfs.c b/net/nfs.c index fe0bc70..f68741a 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -29,6 +29,9 @@ #include <malloc.h> #include <libgen.h> #include <fs.h> +#include <libgen.h> +#include <fcntl.h> +#include <errno.h> #include "nfs.h" /*#define NFS_DEBUG*/ @@ -63,7 +66,7 @@ static char *nfs_filename; static char *nfs_path; static char nfs_path_buff[2048]; -extern int net_store_fd; +static int net_store_fd; static __inline__ int store_block (uchar * src, unsigned offset, unsigned len) @@ -703,3 +706,54 @@ NfsStart (char *p) NfsSend (); } +static int do_nfs (cmd_tbl_t *cmdtp, int argc, char *argv[]) +{ + int rcode = 0; + char *localfile; + char *remotefile; + + if (argc < 2) + return COMMAND_ERROR_USAGE; + + remotefile = argv[1]; + + if (argc == 2) + localfile = basename(remotefile); + else + localfile = argv[2]; + + net_store_fd = open(localfile, O_WRONLY | O_CREAT); + if (net_store_fd < 0) { + perror("open"); + return 1; + } + + if (NetLoopInit(NFS) < 0) + goto out; + + NfsStart(remotefile); + + rcode = NetLoop(); + if (rcode < 0) { + rcode = 1; + goto out; + } + + /* NetLoop ok, update environment */ + netboot_update_env(); + +out: + close(net_store_fd); + return rcode; +} + +static const __maybe_unused char cmd_nfs_help[] = +"Usage: nfs <file> [localfile]\n" +"Load a file via network using nfs protocol.\n"; + +BAREBOX_CMD_START(nfs) + .cmd = do_nfs, + .usage = "boot image via network using nfs protocol", + BAREBOX_CMD_HELP(cmd_nfs_help) +BAREBOX_CMD_END + diff --git a/net/tftp.c b/net/tftp.c index 169855f..b9c6fdd 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -11,6 +11,8 @@ #include <clock.h> #include <fs.h> #include <errno.h> +#include <libgen.h> +#include <fcntl.h> #include "tftp.h" #undef ET_DEBUG @@ -49,7 +51,7 @@ static int TftpState; static char *tftp_filename; -extern int net_store_fd; +static int net_store_fd; static int store_block(unsigned block, uchar * src, unsigned len) { @@ -253,3 +255,71 @@ void TftpStart(char *filename) TftpSend(); } + +static int do_tftpb (cmd_tbl_t *cmdtp, int argc, char *argv[]) +{ + int rcode = 0; + char *localfile; + char *remotefile; + + if (argc < 2) + return COMMAND_ERROR_USAGE; + + remotefile = argv[1]; + + if (argc == 2) + localfile = basename(remotefile); + else + localfile = argv[2]; + + net_store_fd = open(localfile, O_WRONLY | O_CREAT); + if (net_store_fd < 0) { + perror("open"); + return 1; + } + + if (NetLoopInit(TFTP) < 0) + goto out; + + TftpStart(remotefile); + + rcode = NetLoop(); + if (rcode < 0) { + rcode = 1; + goto out; + } + + /* NetLoop ok, update environment */ + netboot_update_env(); + +out: + close(net_store_fd); + return rcode; +} + +static const __maybe_unused char cmd_tftp_help[] = +"Usage: tftp <file> [localfile]\n" +"Load a file via network using BootP/TFTP protocol.\n"; + +BAREBOX_CMD_START(tftp) + .cmd = do_tftpb, + .usage = "Load file using tftp protocol", + BAREBOX_CMD_HELP(cmd_tftp_help) +BAREBOX_CMD_END + +/** + * @page tftp_command tftp + * + * Usage is: tftp \<filename\> [\<localfilename\>] + * + * Load a file via network using BootP/TFTP protocol. The loaded file you + * can find after download in you current ramdisk. Refer \b ls command. + * + * \<localfile> can be the local filename only, or also a device name. In the + * case of a device name, the will gets stored there. This works also for + * partitions of flash memory. Refer \b erase, \b unprotect for flash + * preparation. + * + * Note: This command is available only, if enabled in the menuconfig. + */ + -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 07/12] remove typedef cmd_tbl_t and replace it with struct command 2010-01-25 7:32 ` [PATCH 06/12] Move tftp/nfs specific code to net/* Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 08/12] pcm043: initialize cpufreq to 532MHz Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/cpu/cpu.c | 2 +- arch/arm/cpu/cpuinfo.c | 2 +- arch/arm/lib/armlinux.c | 4 ++-- arch/arm/mach-imx/clko.c | 2 +- arch/arm/mach-imx/speed.c | 2 +- arch/arm/mach-netx/generic.c | 2 +- arch/ppc/mach-mpc5xxx/interrupts.c | 2 +- board/ipe337/cmd_alternate.c | 2 +- board/pcm043/pcm043.c | 2 +- commands/bmp.c | 2 +- commands/bootm.c | 6 +++--- commands/cat.c | 2 +- commands/cd.c | 2 +- commands/clear.c | 2 +- commands/cp.c | 2 +- commands/crc.c | 2 +- commands/dfu.c | 2 +- commands/echo.c | 2 +- commands/edit.c | 2 +- commands/exec.c | 2 +- commands/export.c | 2 +- commands/false.c | 2 +- commands/flash.c | 4 ++-- commands/go.c | 2 +- commands/gpio.c | 8 ++++---- commands/help.c | 2 +- commands/insmod.c | 2 +- commands/loadb.c | 2 +- commands/loadenv.c | 2 +- commands/loads.c | 4 ++-- commands/ls.c | 2 +- commands/lsmod.c | 2 +- commands/mem.c | 10 +++++----- commands/meminfo.c | 2 +- commands/memtest.c | 2 +- commands/mkdir.c | 2 +- commands/mount.c | 2 +- commands/nand.c | 2 +- commands/net.c | 4 ++-- commands/partition.c | 4 ++-- commands/printenv.c | 2 +- commands/pwd.c | 2 +- commands/readline.c | 2 +- commands/reginfo.c | 2 +- commands/reset.c | 2 +- commands/rm.c | 2 +- commands/rmdir.c | 2 +- commands/saveenv.c | 2 +- commands/setenv.c | 2 +- commands/sleep.c | 2 +- commands/test.c | 2 +- commands/timeout.c | 2 +- commands/true.c | 2 +- commands/umount.c | 2 +- commands/version.c | 2 +- common/command.c | 26 +++++++++++++------------- common/complete.c | 2 +- common/hush.c | 6 +++--- common/module.c | 4 ++-- drivers/nand/nand_imx.c | 2 +- drivers/nand/nand_s3c2410.c | 2 +- drivers/usb/gadget/u_serial.c | 2 +- drivers/usb/usb.c | 2 +- include/command.h | 20 ++++++++------------ lib/driver.c | 2 +- net/dhcp.c | 2 +- net/nfs.c | 2 +- net/ping.c | 2 +- net/tftp.c | 2 +- 69 files changed, 105 insertions(+), 109 deletions(-) diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c index 501e9b9..1b8fc97 100644 --- a/arch/arm/cpu/cpu.c +++ b/arch/arm/cpu/cpu.c @@ -162,7 +162,7 @@ int cleanup_before_linux (void) * required. */ -static int do_icache(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_icache(struct command *cmdtp, int argc, char *argv[]) { if (argc == 1) { printf("icache is %sabled\n", icache_status() ? "en" : "dis"); diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c index e7bcda9..e19b8de 100644 --- a/arch/arm/cpu/cpuinfo.c +++ b/arch/arm/cpu/cpuinfo.c @@ -41,7 +41,7 @@ static char *crbits[] = {"M", "A", "C", "W", "P", "D", "L", "B", "S", "R", "F", "Z", "I", "V", "RR", "L4", "", "", "", "", "", "FI", "U", "XP", "VE", "EE", "L2"}; -static int do_cpuinfo(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_cpuinfo(struct command *cmdtp, int argc, char *argv[]) { unsigned long mainid, cache, cr; char *architecture, *implementer; diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index 25b7744..2415c29 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -235,7 +235,7 @@ struct zimage_header { u32 end; }; -static int do_bootz(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_bootz(struct command *cmdtp, int argc, char *argv[]) { void (*theKernel)(int zero, int arch, void *params); const char *commandline = getenv("bootargs"); @@ -308,7 +308,7 @@ BAREBOX_CMD_END #endif /* CONFIG_CMD_BOOTZ */ #ifdef CONFIG_CMD_BOOTU -static int do_bootu(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_bootu(struct command *cmdtp, int argc, char *argv[]) { void (*theKernel)(int zero, int arch, void *params); const char *commandline = getenv("bootargs"); diff --git a/arch/arm/mach-imx/clko.c b/arch/arm/mach-imx/clko.c index b6efe87..37e17fe 100644 --- a/arch/arm/mach-imx/clko.c +++ b/arch/arm/mach-imx/clko.c @@ -4,7 +4,7 @@ #include <mach/imx-regs.h> #include <mach/clock.h> -static int do_clko (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_clko(struct command *cmdtp, int argc, char *argv[]) { int opt, div = 0, src = -2, ret; diff --git a/arch/arm/mach-imx/speed.c b/arch/arm/mach-imx/speed.c index 76ab6b9..e024733 100644 --- a/arch/arm/mach-imx/speed.c +++ b/arch/arm/mach-imx/speed.c @@ -69,7 +69,7 @@ unsigned int imx_decode_pll(unsigned int reg_val, unsigned int freq) extern void imx_dump_clocks(void); -static int do_clocks (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_clocks(struct command *cmdtp, int argc, char *argv[]) { imx_dump_clocks(); diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c index 76ae6bd..69cf196 100644 --- a/arch/arm/mach-netx/generic.c +++ b/arch/arm/mach-netx/generic.c @@ -116,7 +116,7 @@ int loadxc(int xcno) { return 0; } -int do_loadxc (cmd_tbl_t *cmdtp, int argc, char *argv[]) +int do_loadxc(struct command *cmdtp, int argc, char *argv[]) { int xcno; diff --git a/arch/ppc/mach-mpc5xxx/interrupts.c b/arch/ppc/mach-mpc5xxx/interrupts.c index 58f4530..e484b6e 100644 --- a/arch/ppc/mach-mpc5xxx/interrupts.c +++ b/arch/ppc/mach-mpc5xxx/interrupts.c @@ -314,7 +314,7 @@ void irq_free_handler(int irq) /****************************************************************************/ #if (CONFIG_COMMANDS & CFG_CMD_IRQ) -void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) +void do_irqinfo(struct command * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) { int irq, re_enable; u32 intr_ctrl; diff --git a/board/ipe337/cmd_alternate.c b/board/ipe337/cmd_alternate.c index 538f0bf..2883c77 100644 --- a/board/ipe337/cmd_alternate.c +++ b/board/ipe337/cmd_alternate.c @@ -6,7 +6,7 @@ #define MAGIC 0x19691228 -static int do_alternate (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_alternate(struct command *cmdtp, int argc, char *argv[]) { void *buf; size_t size; diff --git a/board/pcm043/pcm043.c b/board/pcm043/pcm043.c index 0e7f6d3..7b0bad1 100644 --- a/board/pcm043/pcm043.c +++ b/board/pcm043/pcm043.c @@ -353,7 +353,7 @@ core_initcall(pcm043_core_setup); #define MPCTL_PARAM_399 (IMX_PLL_PD(0) | IMX_PLL_MFD(15) | IMX_PLL_MFI(8) | IMX_PLL_MFN(5)) #define MPCTL_PARAM_532 ((1 << 31) | IMX_PLL_PD(0) | IMX_PLL_MFD(11) | IMX_PLL_MFI(11) | IMX_PLL_MFN(1)) -static int do_cpufreq(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_cpufreq(struct command *cmdtp, int argc, char *argv[]) { unsigned long freq; diff --git a/commands/bmp.c b/commands/bmp.c index 51989e1..6e17200 100644 --- a/commands/bmp.c +++ b/commands/bmp.c @@ -29,7 +29,7 @@ static inline void set_pixel(struct fb_info *info, void *adr, int r, int g, int } } -static int do_bmp(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_bmp(struct command *cmdtp, int argc, char *argv[]) { int ret, opt, fd; char *fbdev = "/dev/fb0"; diff --git a/commands/bootm.c b/commands/bootm.c index 849d4c2..11325dc 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -52,7 +52,7 @@ * - loaded (first part of) image to header load address, * - disabled interrupts. */ -typedef void boot_os_Fcn (cmd_tbl_t *cmdtp, int flag, +typedef void boot_os_Fcn(struct command *cmdtp, int flag, int argc, char *argv[], ulong addr, /* of image to boot */ ulong *len_ptr, /* multi-file image length table */ @@ -364,7 +364,7 @@ static int handler_parse_options(struct image_data *data, int opt, char *optarg) return -1; } -static int do_bootm (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_bootm(struct command *cmdtp, int argc, char *argv[]) { ulong iflag; int opt; @@ -464,7 +464,7 @@ BAREBOX_CMD_START(bootm) BAREBOX_CMD_END #ifdef CONFIG_CMD_IMI -static int do_iminfo ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_iminfo(struct command *cmdtp, int argc, char *argv[]) { int arg; ulong addr; diff --git a/commands/cat.c b/commands/cat.c index c0a93d8..41b3324 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -39,7 +39,7 @@ * @param[in] argc Argument count from command line * @param[in] argv List of input arguments */ -static int do_cat(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_cat(struct command *cmdtp, int argc, char *argv[]) { int ret; int fd, i; diff --git a/commands/cd.c b/commands/cd.c index 50e40b6..a842f4d 100644 --- a/commands/cd.c +++ b/commands/cd.c @@ -30,7 +30,7 @@ #include <fs.h> #include <errno.h> -static int do_cd (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_cd(struct command *cmdtp, int argc, char *argv[]) { int ret; diff --git a/commands/clear.c b/commands/clear.c index 1788428..7589a0c 100644 --- a/commands/clear.c +++ b/commands/clear.c @@ -24,7 +24,7 @@ #include <command.h> #include <readkey.h> -static int do_clear (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_clear(struct command *cmdtp, int argc, char *argv[]) { printf(ANSI_CLEAR_SCREEN); diff --git a/commands/cp.c b/commands/cp.c index aa7b410..a0c7c84 100644 --- a/commands/cp.c +++ b/commands/cp.c @@ -37,7 +37,7 @@ * @param[in] argc Argument count from command line * @param[in] argv List of input arguments */ -static int do_cp ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_cp(struct command *cmdtp, int argc, char *argv[]) { int ret = 1; struct stat statbuf; diff --git a/commands/crc.c b/commands/crc.c index 17188c7..4842cdc 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -30,7 +30,7 @@ #include <malloc.h> #include <linux/ctype.h> -static int do_crc (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_crc(struct command *cmdtp, int argc, char *argv[]) { ulong start = 0, size = ~0, total = 0; ulong crc = 0, vcrc = 0; diff --git a/commands/dfu.c b/commands/dfu.c index fe865ef..66fd6ea 100644 --- a/commands/dfu.c +++ b/commands/dfu.c @@ -95,7 +95,7 @@ static int dfu_do_parse_one(char *partstr, char **endstr, struct usb_dfu_dev *df * s = save mode (download whole image before flashing) * r = read back (firmware image can be downloaded back from host) */ -static int do_dfu(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_dfu(struct command *cmdtp, int argc, char *argv[]) { int opt, n = 0; struct usb_dfu_pdata pdata; diff --git a/commands/echo.c b/commands/echo.c index 49bd44e..d5640a0 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -26,7 +26,7 @@ #include <fcntl.h> #include <errno.h> -static int do_echo (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_echo(struct command *cmdtp, int argc, char *argv[]) { int i, optind = 1; int fd = stdout, opt, newline = 1; diff --git a/commands/edit.c b/commands/edit.c index d292a52..e851f0f 100644 --- a/commands/edit.c +++ b/commands/edit.c @@ -389,7 +389,7 @@ static void getwinsize(void) { } #endif -static int do_edit(cmd_tbl_t * cmdtp, int argc, char *argv[]) +static int do_edit(struct command * cmdtp, int argc, char *argv[]) { int lastscrcol; int i; diff --git a/commands/exec.c b/commands/exec.c index ce0a0a9..5f093b7 100644 --- a/commands/exec.c +++ b/commands/exec.c @@ -29,7 +29,7 @@ #include <malloc.h> #include <xfuncs.h> -static int do_exec(cmd_tbl_t * cmdtp, int argc, char *argv[]) +static int do_exec(struct command * cmdtp, int argc, char *argv[]) { int i; char *script; diff --git a/commands/export.c b/commands/export.c index 3e2f84d..31259cc 100644 --- a/commands/export.c +++ b/commands/export.c @@ -28,7 +28,7 @@ #include <errno.h> #include <environment.h> -static int do_export ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_export(struct command *cmdtp, int argc, char *argv[]) { int i = 1; char *ptr; diff --git a/commands/false.c b/commands/false.c index fec3fdf..a90eadc 100644 --- a/commands/false.c +++ b/commands/false.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -static int do_false (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_false(struct command *cmdtp, int argc, char *argv[]) { return 1; } diff --git a/commands/flash.c b/commands/flash.c index ec793c5..f92b604 100644 --- a/commands/flash.c +++ b/commands/flash.c @@ -37,7 +37,7 @@ #include <fcntl.h> #include <linux/stat.h> -static int do_flerase (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_flerase(struct command *cmdtp, int argc, char *argv[]) { int fd; char *filename = NULL; @@ -107,7 +107,7 @@ BAREBOX_CMD_END * Refer \b addpart, \b delpart and \b devinfo for partition handling. */ -static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_protect(struct command *cmdtp, int argc, char *argv[]) { int fd; char *filename = NULL; diff --git a/commands/go.c b/commands/go.c index e720e32..588d6fc 100644 --- a/commands/go.c +++ b/commands/go.c @@ -30,7 +30,7 @@ #include <linux/ctype.h> #include <errno.h> -static int do_go (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_go(struct command *cmdtp, int argc, char *argv[]) { void *addr; int rcode = 1; diff --git a/commands/gpio.c b/commands/gpio.c index 58bf8b6..2575c1e 100644 --- a/commands/gpio.c +++ b/commands/gpio.c @@ -20,7 +20,7 @@ #include <errno.h> #include <gpio.h> -static int do_gpio_get_value(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_gpio_get_value(struct command *cmdtp, int argc, char *argv[]) { int gpio, value; @@ -45,7 +45,7 @@ BAREBOX_CMD_START(gpio_get_value) BAREBOX_CMD_HELP(cmd_gpio_get_value_help) BAREBOX_CMD_END -static int do_gpio_set_value(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_gpio_set_value(struct command *cmdtp, int argc, char *argv[]) { int gpio, value; @@ -69,7 +69,7 @@ BAREBOX_CMD_START(gpio_set_value) BAREBOX_CMD_HELP(cmd_gpio_set_value_help) BAREBOX_CMD_END -static int do_gpio_direction_input(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_gpio_direction_input(struct command *cmdtp, int argc, char *argv[]) { int gpio, ret; @@ -94,7 +94,7 @@ BAREBOX_CMD_START(gpio_direction_input) BAREBOX_CMD_HELP(cmd_do_gpio_direction_input_help) BAREBOX_CMD_END -static int do_gpio_direction_output(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_gpio_direction_output(struct command *cmdtp, int argc, char *argv[]) { int gpio, value, ret; diff --git a/commands/help.c b/commands/help.c index d8c67cd..f8387bd 100644 --- a/commands/help.c +++ b/commands/help.c @@ -28,7 +28,7 @@ * Use puts() instead of printf() to avoid printf buffer overflow * for long help messages */ -static int do_help (cmd_tbl_t * cmdtp, int argc, char *argv[]) +static int do_help(struct command * cmdtp, int argc, char *argv[]) { if (argc == 1) { /* show list of commands */ for_each_command(cmdtp) { diff --git a/commands/insmod.c b/commands/insmod.c index e14af49..d3b4d1a 100644 --- a/commands/insmod.c +++ b/commands/insmod.c @@ -5,7 +5,7 @@ #include <fs.h> #include <malloc.h> -static int do_insmod (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_insmod(struct command *cmdtp, int argc, char *argv[]) { struct module *module; void *buf; diff --git a/commands/loadb.c b/commands/loadb.c index efb1a3c..6740ef4 100644 --- a/commands/loadb.c +++ b/commands/loadb.c @@ -688,7 +688,7 @@ static struct console_device *get_current_console(void) * * @return success or failure */ -static int do_load_serial_bin(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_load_serial_bin(struct command *cmdtp, int argc, char *argv[]) { ulong offset = 0; ulong addr; diff --git a/commands/loadenv.c b/commands/loadenv.c index 8b885ab..14fbf1e 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -27,7 +27,7 @@ #include <command.h> #include <environment.h> -static int do_loadenv(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_loadenv(struct command *cmdtp, int argc, char *argv[]) { char *filename, *dirname; diff --git a/commands/loads.c b/commands/loads.c index 2578c15..8269af1 100644 --- a/commands/loads.c +++ b/commands/loads.c @@ -42,7 +42,7 @@ static int save_serial (ulong offset, ulong size); static int write_record (char *buf); # endif /* CFG_CMD_SAVES */ -int do_load_serial (cmd_tbl_t *cmdtp, int argc, char *argv[]) +int do_load_serial(struct command *cmdtp, int argc, char *argv[]) { ulong offset = 0; ulong addr; @@ -233,7 +233,7 @@ read_record (char *buf, ulong len) #if (CONFIG_COMMANDS & CFG_CMD_SAVES) -int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_save_serial(struct command *cmdtp, int flag, int argc, char *argv[]) { ulong offset = 0; ulong size = 0; diff --git a/commands/ls.c b/commands/ls.c index 4d880e5..a02ccfe 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -111,7 +111,7 @@ out: return 0; } -static int do_ls (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_ls(struct command *cmdtp, int argc, char *argv[]) { int ret, opt, o; struct stat s; diff --git a/commands/lsmod.c b/commands/lsmod.c index 696304d..26d2fe4 100644 --- a/commands/lsmod.c +++ b/commands/lsmod.c @@ -2,7 +2,7 @@ #include <command.h> #include <module.h> -static int do_lsmod (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_lsmod(struct command *cmdtp, int argc, char *argv[]) { struct module *mod; diff --git a/commands/mem.c b/commands/mem.c index f06bc64..6192466 100644 --- a/commands/mem.c +++ b/commands/mem.c @@ -163,7 +163,7 @@ static int mem_parse_options(int argc, char *argv[], char *optstr, int *mode, return 0; } -static int do_mem_md(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mem_md(struct command *cmdtp, int argc, char *argv[]) { ulong start = 0, size = 0x100; int r, now; @@ -238,7 +238,7 @@ BAREBOX_CMD_START(md) BAREBOX_CMD_HELP(cmd_md_help) BAREBOX_CMD_END -static int do_mem_mw ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mem_mw(struct command *cmdtp, int argc, char *argv[]) { int ret = 0; int fd; @@ -301,7 +301,7 @@ BAREBOX_CMD_START(mw) BAREBOX_CMD_HELP(cmd_mw_help) BAREBOX_CMD_END -static int do_mem_cmp(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mem_cmp(struct command *cmdtp, int argc, char *argv[]) { ulong addr1, addr2, count = ~0; int mode = O_RWSIZE_1; @@ -410,7 +410,7 @@ BAREBOX_CMD_START(memcmp) BAREBOX_CMD_HELP(cmd_memcmp_help) BAREBOX_CMD_END -static int do_mem_cp(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mem_cp(struct command *cmdtp, int argc, char *argv[]) { ulong count; ulong dest, src; @@ -506,7 +506,7 @@ BAREBOX_CMD_START(memcpy) BAREBOX_CMD_HELP(cmd_memcpy_help) BAREBOX_CMD_END -static int do_memset(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_memset(struct command *cmdtp, int argc, char *argv[]) { ulong s, c, n; int fd; diff --git a/commands/meminfo.c b/commands/meminfo.c index 76caf0a..abbaf9c 100644 --- a/commands/meminfo.c +++ b/commands/meminfo.c @@ -23,7 +23,7 @@ #include <command.h> #include <malloc.h> -static int do_meminfo (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_meminfo(struct command *cmdtp, int argc, char *argv[]) { malloc_stats(); diff --git a/commands/memtest.c b/commands/memtest.c index 4038ace..d9c8b3d 100644 --- a/commands/memtest.c +++ b/commands/memtest.c @@ -322,7 +322,7 @@ static int mem_test(ulong _start, ulong _end, ulong pattern) } #endif -static int do_mem_mtest (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mem_mtest(struct command *cmdtp, int argc, char *argv[]) { ulong start, end, pattern = 0; diff --git a/commands/mkdir.c b/commands/mkdir.c index d5f58f0..b66795b 100644 --- a/commands/mkdir.c +++ b/commands/mkdir.c @@ -26,7 +26,7 @@ #include <errno.h> #include <getopt.h> -static int do_mkdir (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mkdir(struct command *cmdtp, int argc, char *argv[]) { int opt, parent = 0, ret; diff --git a/commands/mount.c b/commands/mount.c index 41735c8..8e4388e 100644 --- a/commands/mount.c +++ b/commands/mount.c @@ -30,7 +30,7 @@ #include <fs.h> #include <errno.h> -static int do_mount (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mount(struct command *cmdtp, int argc, char *argv[]) { int ret = 0; struct mtab_entry *entry = NULL; diff --git a/commands/nand.c b/commands/nand.c index 55b89af..7a4e995 100644 --- a/commands/nand.c +++ b/commands/nand.c @@ -279,7 +279,7 @@ out1: #define NAND_DEL (1 << 1) #define NAND_MARKBAD (1 << 2) -static int do_nand(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_nand(struct command *cmdtp, int argc, char *argv[]) { int opt; struct nand_bb *bb; diff --git a/commands/net.c b/commands/net.c index 5fa49cf..815a566 100644 --- a/commands/net.c +++ b/commands/net.c @@ -76,7 +76,7 @@ void netboot_update_env(void) #ifdef CONFIG_NET_RARP extern void RarpRequest(void); -static int do_rarpb (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_rarpb(struct command *cmdtp, int argc, char *argv[]) { int size; @@ -102,7 +102,7 @@ BAREBOX_CMD_START(rarpboot) BAREBOX_CMD_END #endif /* CONFIG_NET_RARP */ -static int do_ethact (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_ethact(struct command *cmdtp, int argc, char *argv[]) { struct eth_device *edev; diff --git a/commands/partition.c b/commands/partition.c index 3cb7b61..e4645e8 100755 --- a/commands/partition.c +++ b/commands/partition.c @@ -99,7 +99,7 @@ static int mtd_part_do_parse_one(char *devname, const char *partstr, return ret; } -static int do_addpart(cmd_tbl_t * cmdtp, int argc, char *argv[]) +static int do_addpart(struct command * cmdtp, int argc, char *argv[]) { char *devname; char *endp; @@ -180,7 +180,7 @@ BAREBOX_CMD_END * @note This command has to be reworked and will probably change it's API. */ -static int do_delpart(cmd_tbl_t * cmdtp, int argc, char *argv[]) +static int do_delpart(struct command * cmdtp, int argc, char *argv[]) { int i, err; diff --git a/commands/printenv.c b/commands/printenv.c index 5490980..e6fc0e4 100644 --- a/commands/printenv.c +++ b/commands/printenv.c @@ -28,7 +28,7 @@ #include <errno.h> #include <environment.h> -static int do_printenv (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_printenv(struct command *cmdtp, int argc, char *argv[]) { struct variable_d *var; struct env_context *c, *current_c; diff --git a/commands/pwd.c b/commands/pwd.c index 6c3cbb9..d51fa1a 100644 --- a/commands/pwd.c +++ b/commands/pwd.c @@ -23,7 +23,7 @@ #include <command.h> #include <fs.h> -static int do_pwd (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_pwd(struct command *cmdtp, int argc, char *argv[]) { printf("%s\n", getcwd()); return 0; diff --git a/commands/readline.c b/commands/readline.c index 55c288c..cf2625f 100644 --- a/commands/readline.c +++ b/commands/readline.c @@ -27,7 +27,7 @@ #include <xfuncs.h> #include <environment.h> -static int do_readline (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_readline(struct command *cmdtp, int argc, char *argv[]) { char *buf = xzalloc(CONFIG_CBSIZE); diff --git a/commands/reginfo.c b/commands/reginfo.c index f11a73c..90651d5 100644 --- a/commands/reginfo.c +++ b/commands/reginfo.c @@ -23,7 +23,7 @@ #include <common.h> #include <command.h> -static int do_reginfo (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_reginfo(struct command *cmdtp, int argc, char *argv[]) { reginfo(); return 0; diff --git a/commands/reset.c b/commands/reset.c index f148623..46ab901 100644 --- a/commands/reset.c +++ b/commands/reset.c @@ -23,7 +23,7 @@ #include <common.h> #include <command.h> -static int cmd_reset (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int cmd_reset(struct command *cmdtp, int argc, char *argv[]) { reset_cpu(0); diff --git a/commands/rm.c b/commands/rm.c index 8694606..3437ae5 100644 --- a/commands/rm.c +++ b/commands/rm.c @@ -24,7 +24,7 @@ #include <fs.h> #include <errno.h> -static int do_rm (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_rm(struct command *cmdtp, int argc, char *argv[]) { int i = 1; diff --git a/commands/rmdir.c b/commands/rmdir.c index 3531f32..83a0b02 100644 --- a/commands/rmdir.c +++ b/commands/rmdir.c @@ -3,7 +3,7 @@ #include <fs.h> #include <errno.h> -static int do_rmdir (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_rmdir(struct command *cmdtp, int argc, char *argv[]) { int i = 1; diff --git a/commands/saveenv.c b/commands/saveenv.c index 6a9da5c..42ea58f 100644 --- a/commands/saveenv.c +++ b/commands/saveenv.c @@ -30,7 +30,7 @@ #include <fcntl.h> #include <environment.h> -static int do_saveenv(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_saveenv(struct command *cmdtp, int argc, char *argv[]) { int ret, fd; char *filename, *dirname; diff --git a/commands/setenv.c b/commands/setenv.c index 16b8177..257348f 100644 --- a/commands/setenv.c +++ b/commands/setenv.c @@ -28,7 +28,7 @@ #include <errno.h> #include <environment.h> -static int do_setenv ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_setenv(struct command *cmdtp, int argc, char *argv[]) { if (argc < 2) return COMMAND_ERROR_USAGE; diff --git a/commands/sleep.c b/commands/sleep.c index d88f39e..40a3a47 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -24,7 +24,7 @@ #include <command.h> #include <clock.h> -static int do_sleep (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_sleep(struct command *cmdtp, int argc, char *argv[]) { uint64_t start; ulong delay; diff --git a/commands/test.c b/commands/test.c index afabe12..4af3515 100644 --- a/commands/test.c +++ b/commands/test.c @@ -76,7 +76,7 @@ static int parse_opt(const char *opt) return -1; } -static int do_test (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_test(struct command *cmdtp, int argc, char *argv[]) { char **ap; int left, adv, expr, last_expr, neg, last_cmp, opt, zero; diff --git a/commands/timeout.c b/commands/timeout.c index dfbefc9..5f2ab9a 100644 --- a/commands/timeout.c +++ b/commands/timeout.c @@ -31,7 +31,7 @@ #define TIMEOUT_ANYKEY (1 << 2) #define TIMEOUT_SILENT (1 << 3) -static int do_timeout(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_timeout(struct command *cmdtp, int argc, char *argv[]) { int timeout = 3, ret = 1; int flags = 0, opt, countdown; diff --git a/commands/true.c b/commands/true.c index 4697a81..8c77dec 100644 --- a/commands/true.c +++ b/commands/true.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -static int do_true (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_true(struct command *cmdtp, int argc, char *argv[]) { return 0; } diff --git a/commands/umount.c b/commands/umount.c index 0dc517a..6ae5844 100644 --- a/commands/umount.c +++ b/commands/umount.c @@ -24,7 +24,7 @@ #include <fs.h> #include <errno.h> -static int do_umount (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_umount(struct command *cmdtp, int argc, char *argv[]) { int ret = 0; diff --git a/commands/version.c b/commands/version.c index 425f430..6c683d9 100644 --- a/commands/version.c +++ b/commands/version.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -static int do_version (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_version(struct command *cmdtp, int argc, char *argv[]) { extern char version_string[]; printf ("\n%s\n", version_string); diff --git a/common/command.c b/common/command.c index e21e80d..8ed1072 100644 --- a/common/command.c +++ b/common/command.c @@ -44,7 +44,7 @@ EXPORT_SYMBOL(command_list); #ifdef CONFIG_SHELL_HUSH -static int do_exit (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_exit(struct command *cmdtp, int argc, char *argv[]) { int r; @@ -62,7 +62,7 @@ BAREBOX_CMD_END #endif -void barebox_cmd_usage(cmd_tbl_t *cmdtp) +void barebox_cmd_usage(struct command *cmdtp) { #ifdef CONFIG_LONGHELP /* found - print (long) help info */ @@ -85,15 +85,15 @@ EXPORT_SYMBOL(barebox_cmd_usage); static int compare(struct list_head *a, struct list_head *b) { - char *na = (char*)list_entry(a, cmd_tbl_t, list)->name; - char *nb = (char*)list_entry(b, cmd_tbl_t, list)->name; + char *na = (char*)list_entry(a, struct command, list)->name; + char *nb = (char*)list_entry(b, struct command, list)->name; return strcmp(na, nb); } int execute_command(int argc, char **argv) { - cmd_tbl_t *cmdtp; + struct command *cmdtp; int ret; getopt_reset(); @@ -117,7 +117,7 @@ int execute_command(int argc, char **argv) } } -int register_command(cmd_tbl_t *cmd) +int register_command(struct command *cmd) { /* * We do not check if the command already exists. @@ -133,9 +133,9 @@ int register_command(cmd_tbl_t *cmd) char **aliases = (char**)cmd->aliases; while(*aliases) { char *usage = "alias for "; - cmd_tbl_t *c = xzalloc(sizeof(cmd_tbl_t)); + struct command *c = xzalloc(sizeof(struct command)); - memcpy(c, cmd, sizeof(cmd_tbl_t)); + memcpy(c, cmd, sizeof(struct command)); c->name = *aliases; c->usage = xmalloc(strlen(usage) + strlen(cmd->name) + 1); @@ -156,15 +156,15 @@ EXPORT_SYMBOL(register_command); /* * find command table entry for a command */ -cmd_tbl_t *find_cmd (const char *cmd) +struct command *find_cmd (const char *cmd) { - cmd_tbl_t *cmdtp; - cmd_tbl_t *cmdtp_temp = &__barebox_cmd_start; /*Init value */ + struct command *cmdtp; + struct command *cmdtp_temp = &__barebox_cmd_start; /*Init value */ int len; int n_found = 0; len = strlen (cmd); - cmdtp = list_entry(&command_list, cmd_tbl_t, list); + cmdtp = list_entry(&command_list, struct command, list); for_each_command(cmdtp) { if (strncmp (cmd, cmdtp->name, len) == 0) { @@ -191,7 +191,7 @@ cmd_tbl_t *find_cmd (const char *cmd) */ static int init_command_list(void) { - cmd_tbl_t *cmdtp; + struct command *cmdtp; for (cmdtp = &__barebox_cmd_start; cmdtp != &__barebox_cmd_end; diff --git a/common/complete.c b/common/complete.c index 87435ee..46ba871 100644 --- a/common/complete.c +++ b/common/complete.c @@ -69,7 +69,7 @@ out: static int command_complete(struct string_list *sl, char *instr) { - cmd_tbl_t *cmdtp; + struct command *cmdtp; char cmd[128]; for_each_command(cmdtp) { diff --git a/common/hush.c b/common/hush.c index e7a13c2..cf6704b 100644 --- a/common/hush.c +++ b/common/hush.c @@ -122,7 +122,7 @@ #include <glob.h> /*cmd_boot.c*/ -extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */ +extern int do_bootd(struct command *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */ #define SPECIAL_VAR_SYMBOL 03 @@ -1583,7 +1583,7 @@ int run_shell(void) return rcode; } -static int do_sh(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_sh(struct command *cmdtp, int argc, char *argv[]) { if (argc < 2) return COMMAND_ERROR_USAGE; @@ -1602,7 +1602,7 @@ BAREBOX_CMD_START(sh) BAREBOX_CMD_HELP(cmd_sh_help) BAREBOX_CMD_END -static int do_source(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_source(struct command *cmdtp, int argc, char *argv[]) { if (argc < 2) return COMMAND_ERROR_USAGE; diff --git a/common/module.c b/common/module.c index cedd702..29f3eb7 100644 --- a/common/module.c +++ b/common/module.c @@ -297,8 +297,8 @@ struct module * load_module(void *mod_image, unsigned long len) #ifdef CONFIG_COMMAND cmdindex = find_sec(ehdr, sechdrs, secstrings, ".barebox_cmd"); if (cmdindex) { - cmd_tbl_t *cmd = (cmd_tbl_t *)sechdrs[cmdindex].sh_addr; - for (i = 0; i < sechdrs[cmdindex].sh_size / sizeof(cmd_tbl_t); i++) { + struct command *cmd =(struct command *)sechdrs[cmdindex].sh_addr; + for (i = 0; i < sechdrs[cmdindex].sh_size / sizeof(struct command); i++) { register_command(cmd); cmd++; } diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c index 5811e27..5b3b002 100644 --- a/drivers/nand/nand_imx.c +++ b/drivers/nand/nand_imx.c @@ -1129,7 +1129,7 @@ void __nand_boot_init imx_nand_load_image(void *dest, int size) #ifdef CONFIG_NAND_IMX_BOOT_DEBUG #include <command.h> -static int do_nand_boot_test(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_nand_boot_test(struct command *cmdtp, int argc, char *argv[]) { void *dest; int size; diff --git a/drivers/nand/nand_s3c2410.c b/drivers/nand/nand_s3c2410.c index 2f98c76..b989583 100644 --- a/drivers/nand/nand_s3c2410.c +++ b/drivers/nand/nand_s3c2410.c @@ -484,7 +484,7 @@ void __nand_boot_init s3c24x0_nand_load_image(void *dest, int size, int page, in #ifdef CONFIG_NAND_S3C24XX_BOOT_DEBUG #include <command.h> -static int do_nand_boot_test(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_nand_boot_test(struct command *cmdtp, int argc, char *argv[]) { void *dest; int size, pagesize; diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index d3b49ed..cb65b19 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -470,7 +470,7 @@ fail_out: } #include <command.h> -static int do_mycdev (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_mycdev(struct command *cmdtp, int argc, char *argv[]) { int i,j; diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c index decdbdd..1ad4bab 100644 --- a/drivers/usb/usb.c +++ b/drivers/usb/usb.c @@ -478,7 +478,7 @@ static int __usb_init(void) return 0; } -static int do_usb(cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_usb(struct command *cmdtp, int argc, char *argv[]) { __usb_init(); diff --git a/include/command.h b/include/command.h index 393438d..a612d65 100644 --- a/include/command.h +++ b/include/command.h @@ -42,12 +42,11 @@ extern struct list_head command_list; /* * Monitor Command Table */ - -struct cmd_tbl_s { +struct command { const char *name; /* Command Name */ const char **aliases; /* Implementation function */ - int (*cmd)(struct cmd_tbl_s *, int, char *[]); + int (*cmd)(struct command *, int, char *[]); const char *usage; /* Usage message (short) */ struct list_head list; /* List of commands */ @@ -61,17 +60,14 @@ __attribute__((aligned(64))) #endif ; - -typedef struct cmd_tbl_s cmd_tbl_t; - -extern cmd_tbl_t __barebox_cmd_start; -extern cmd_tbl_t __barebox_cmd_end; +extern struct command __barebox_cmd_start; +extern struct command __barebox_cmd_end; /* common/command.c */ -cmd_tbl_t *find_cmd(const char *cmd); +struct command *find_cmd(const char *cmd); int execute_command(int argc, char **argv); -void barebox_cmd_usage(cmd_tbl_t *cmdtp); +void barebox_cmd_usage(struct command *cmdtp); #define COMMAND_SUCCESS 0 #define COMMAND_ERROR 1 @@ -86,7 +82,7 @@ void barebox_cmd_usage(cmd_tbl_t *cmdtp); #define Struct_Section __attribute__ ((unused,section (".barebox_cmd"))) #define BAREBOX_CMD_START(_name) \ -const cmd_tbl_t __barebox_cmd_##_name \ +const struct command __barebox_cmd_##_name \ __attribute__ ((unused,section (".barebox_cmd_" __stringify(_name)))) = { \ .name = #_name, @@ -99,6 +95,6 @@ const cmd_tbl_t __barebox_cmd_##_name \ #define BAREBOX_CMD_HELP(text) #endif -int register_command(cmd_tbl_t *); +int register_command(struct command *); #endif /* __COMMAND_H */ diff --git a/lib/driver.c b/lib/driver.c index b3115de..f433c3e 100644 --- a/lib/driver.c +++ b/lib/driver.c @@ -280,7 +280,7 @@ void devices_shutdown(void) #ifdef CONFIG_CMD_DEVINFO -static int do_devinfo ( cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_devinfo(struct command *cmdtp, int argc, char *argv[]) { struct device_d *dev; struct driver_d *drv; diff --git a/net/dhcp.c b/net/dhcp.c index 1c479cf..f27a696 100644 --- a/net/dhcp.c +++ b/net/dhcp.c @@ -589,7 +589,7 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len) } -static int do_dhcp (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_dhcp(struct command *cmdtp, int argc, char *argv[]) { int size; diff --git a/net/nfs.c b/net/nfs.c index f68741a..15f91ab 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -706,7 +706,7 @@ NfsStart (char *p) NfsSend (); } -static int do_nfs (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_nfs(struct command *cmdtp, int argc, char *argv[]) { int rcode = 0; char *localfile; diff --git a/net/ping.c b/net/ping.c index 7a1fda2..8759fd7 100644 --- a/net/ping.c +++ b/net/ping.c @@ -81,7 +81,7 @@ PingHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len) NetState = NETLOOP_SUCCESS; } -int do_ping (cmd_tbl_t *cmdtp, int argc, char *argv[]) +int do_ping(struct command *cmdtp, int argc, char *argv[]) { if (argc < 2 || string_to_ip(argv[1], &NetPingIP)) return COMMAND_ERROR_USAGE; diff --git a/net/tftp.c b/net/tftp.c index b9c6fdd..897bc48 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -256,7 +256,7 @@ void TftpStart(char *filename) TftpSend(); } -static int do_tftpb (cmd_tbl_t *cmdtp, int argc, char *argv[]) +static int do_tftpb(struct command *cmdtp, int argc, char *argv[]) { int rcode = 0; char *localfile; -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 08/12] pcm043: initialize cpufreq to 532MHz 2010-01-25 7:32 ` [PATCH 07/12] remove typedef cmd_tbl_t and replace it with struct command Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 09/12] replace ET_DEBUG with pr_debug Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- board/pcm043/lowlevel_init.S | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/pcm043/lowlevel_init.S b/board/pcm043/lowlevel_init.S index 9df064c..abbc72c 100644 --- a/board/pcm043/lowlevel_init.S +++ b/board/pcm043/lowlevel_init.S @@ -96,7 +96,7 @@ board_init_lowlevel: ldr r2, CCM_CCMR_W str r2, [r0, #CCM_CCMR] - ldr r3, MPCTL_PARAM_399_W /* consumer path*/ + ldr r3, MPCTL_PARAM_532_W /* consumer path*/ /*Set MPLL , arm clock and ahb clock*/ str r3, [r0, #CCM_MPCTL] -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 09/12] replace ET_DEBUG with pr_debug 2010-01-25 7:32 ` [PATCH 08/12] pcm043: initialize cpufreq to 532MHz Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 10/12] put only once used function inline Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- net/net.c | 69 ++++++++++++++++++++--------------------------------------- net/ping.c | 4 +-- net/tftp.c | 2 - 3 files changed, 25 insertions(+), 50 deletions(-) diff --git a/net/net.c b/net/net.c index 9818f42..7dc1bc6 100644 --- a/net/net.c +++ b/net/net.c @@ -153,9 +153,8 @@ void ArpRequest (void) uchar *pkt; ARP_t *arp; -#ifdef ET_DEBUG - printf ("ARP broadcast\n"); -#endif + pr_debug("ARP broadcast\n"); + pkt = NetTxPacket; pkt += NetSetEther (pkt, NetBcastAddr, PROT_ARP); @@ -379,10 +378,8 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len) /* if MAC address was not discovered yet, save the packet and do an ARP request */ if (memcmp(ether, NetEtherNullAddr, 6) == 0) { + pr_debug("sending ARP for %08lx\n", dest); -#ifdef ET_DEBUG - printf("sending ARP for %08lx\n", dest); -#endif NetArpWaitPacketIP = dest; NetArpWaitPacketMAC = ether; @@ -401,10 +398,8 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len) return 1; /* waiting */ } -#ifdef ET_DEBUG - printf("sending UDP to %08lx/%02x:%02x:%02x:%02x:%02x:%02x\n", + pr_debug("sending UDP to %08lx/%02x:%02x:%02x:%02x:%02x:%02x\n", dest, ether[0], ether[1], ether[2], ether[3], ether[4], ether[5]); -#endif pkt = (uchar *)NetTxPacket; pkt += NetSetEther (pkt, ether, PROT_IP); @@ -425,9 +420,7 @@ NetReceive(uchar * inpkt, int len) uchar *pkt; ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid; -#ifdef ET_DEBUG - printf("packet received\n"); -#endif + pr_debug("packet received\n"); NetRxPkt = inpkt; NetRxPktLen = len; @@ -446,9 +439,7 @@ NetReceive(uchar * inpkt, int len) x = ntohs(et->et_protlen); -#ifdef ET_DEBUG - printf("packet received\n"); -#endif + pr_debug("packet received\n"); if (x < 1514) { /* @@ -466,9 +457,8 @@ NetReceive(uchar * inpkt, int len) } else { /* VLAN packet */ VLAN_Ethernet_t *vet = (VLAN_Ethernet_t *)et; -#ifdef ET_DEBUG - printf("VLAN packet received\n"); -#endif + pr_debug("VLAN packet received\n"); + /* too small packet? */ if (len < VLAN_ETHER_HDR_SIZE) return; @@ -486,9 +476,7 @@ NetReceive(uchar * inpkt, int len) len -= VLAN_ETHER_HDR_SIZE; } -#ifdef ET_DEBUG - printf("Receive from protocol 0x%x\n", x); -#endif + pr_debug("Receive from protocol 0x%x\n", x); if ((myvlanid & VLAN_IDMASK) != VLAN_NONE) { if (vlanid == VLAN_NONE) @@ -510,9 +498,8 @@ NetReceive(uchar * inpkt, int len) * address; so if we receive such a packet, we set * the server ethernet address */ -#ifdef ET_DEBUG - puts ("Got ARP\n"); -#endif + pr_debug("Got ARP\n"); + arp = (ARP_t *)ip; if (len < ARP_HDR_SIZE) { printf("bad length %d < %d\n", len, ARP_HDR_SIZE); @@ -541,9 +528,8 @@ NetReceive(uchar * inpkt, int len) switch (ntohs(arp->ar_op)) { case ARPOP_REQUEST: /* reply with our IP address */ -#ifdef ET_DEBUG - puts ("Got ARP REQUEST, return our IP\n"); -#endif + pr_debug("Got ARP REQUEST, return our IP\n"); + pkt = (uchar *)et; pkt += NetSetEther(pkt, et->et_src, PROT_ARP); arp->ar_op = htons(ARPOP_REPLY); @@ -559,20 +545,17 @@ NetReceive(uchar * inpkt, int len) /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; -#ifdef ET_DEBUG - printf("Got ARP REPLY, set server/gtwy eth addr (%02x:%02x:%02x:%02x:%02x:%02x)\n", + pr_debug("Got ARP REPLY, set server/gtwy eth addr (%02x:%02x:%02x:%02x:%02x:%02x)\n", arp->ar_data[0], arp->ar_data[1], arp->ar_data[2], arp->ar_data[3], arp->ar_data[4], arp->ar_data[5]); -#endif tmp = NetReadIP(&arp->ar_data[6]); /* matched waiting packet's address */ if (tmp == NetArpWaitReplyIP) { -#ifdef ET_DEBUG - puts ("Got it\n"); -#endif + pr_debug("Got it\n"); + /* save address for later use */ memcpy(NetArpWaitPacketMAC, &arp->ar_data[0], 6); @@ -588,17 +571,14 @@ NetReceive(uchar * inpkt, int len) } return; default: -#ifdef ET_DEBUG - printf("Unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op)); -#endif + pr_debug("Unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op)); return; } break; case PROT_RARP: -#ifdef ET_DEBUG - puts ("Got RARP\n"); -#endif + pr_debug("Got RARP\n"); + arp = (ARP_t *)ip; if (len < ARP_HDR_SIZE) { printf("bad length %d < %d\n", len, ARP_HDR_SIZE); @@ -622,9 +602,8 @@ NetReceive(uchar * inpkt, int len) break; case PROT_IP: -#ifdef ET_DEBUG - puts ("Got IP\n"); -#endif + pr_debug("Got IP\n"); + if (len < IP_HDR_SIZE) { debug ("len bad %d < %d\n", len, IP_HDR_SIZE); return; @@ -634,9 +613,9 @@ NetReceive(uchar * inpkt, int len) return; } len = ntohs(ip->ip_len); -#ifdef ET_DEBUG - printf("len=%d, v=%02x\n", len, ip->ip_hl_v & 0xff); -#endif + + pr_debug("len=%d, v=%02x\n", len, ip->ip_hl_v & 0xff); + if ((ip->ip_hl_v & 0xf0) != 0x40) { return; } diff --git a/net/ping.c b/net/ping.c index 8759fd7..1bc481a 100644 --- a/net/ping.c +++ b/net/ping.c @@ -18,9 +18,7 @@ static int PingSend(void) memcpy(mac, NetEtherNullAddr, 6); -#ifdef ET_DEBUG - printf("sending ARP for %08lx\n", NetPingIP); -#endif + pr_debug("sending ARP for %08lx\n", NetPingIP); NetArpWaitPacketIP = NetPingIP; NetArpWaitPacketMAC = mac; diff --git a/net/tftp.c b/net/tftp.c index 897bc48..26f0c43 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -15,8 +15,6 @@ #include <fcntl.h> #include "tftp.h" -#undef ET_DEBUG - #define WELL_KNOWN_PORT 69 /* Well known TFTP port # */ #define TIMEOUT 5 /* Seconds to timeout for a lost pkt */ # define TIMEOUT_COUNT 10 /* # of timeouts before giving up */ -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 10/12] put only once used function inline 2010-01-25 7:32 ` [PATCH 09/12] replace ET_DEBUG with pr_debug Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 11/12] add armv6 support to the konfig system Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- net/net.c | 19 ++++++------------- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/net/net.c b/net/net.c index 7dc1bc6..4554d49 100644 --- a/net/net.c +++ b/net/net.c @@ -189,18 +189,6 @@ void ArpRequest (void) (void) eth_send (NetTxPacket, (pkt - NetTxPacket) + ARP_HDR_SIZE); } -static void ArpTimeoutCheck(void) -{ - if (!NetArpWaitPacketIP) - return; - - /* check for arp timeout */ - if (is_timeout(NetArpWaitTimerStart, ARP_TIMEOUT)) { - NetArpWaitTimerStart = get_time_ns(); - ArpRequest(); - } -} - /**********************************************************************/ /* * Main network processing loop. @@ -298,7 +286,12 @@ int NetLoop(void) return -1; } - ArpTimeoutCheck(); + /* check for arp timeout */ + if (NetArpWaitPacketIP && + is_timeout(NetArpWaitTimerStart, ARP_TIMEOUT)) { + NetArpWaitTimerStart = get_time_ns(); + ArpRequest(); + } /* * Check for a timeout, and run the timeout handler -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 11/12] add armv6 support to the konfig system 2010-01-25 7:32 ` [PATCH 10/12] put only once used function inline Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 2010-01-25 7:32 ` [PATCH 12/12] i.MX: select armv6 for i.MX31/35 Sascha Hauer 0 siblings, 1 reply; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/cpu/Kconfig | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig index cbec793..be01f3d 100644 --- a/arch/arm/cpu/Kconfig +++ b/arch/arm/cpu/Kconfig @@ -35,6 +35,11 @@ config CPU_ARM926T Say Y if you want support for the ARM926T processor. Otherwise, say N. +# ARMv6 +config CPU_V6 + bool + select CPU_32v6 + # ARMv7 config CPU_V7 bool @@ -48,6 +53,9 @@ config CPU_32v4T config CPU_32v5 bool +config CPU_32v6 + bool + config CPU_32v7 bool -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 12/12] i.MX: select armv6 for i.MX31/35 2010-01-25 7:32 ` [PATCH 11/12] add armv6 support to the konfig system Sascha Hauer @ 2010-01-25 7:32 ` Sascha Hauer 0 siblings, 0 replies; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:32 UTC (permalink / raw) To: barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/mach-imx/Kconfig | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index a1b2c1c..eeb392a 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -57,10 +57,12 @@ config ARCH_IMX27 select ARCH_HAS_FEC_IMX config ARCH_IMX31 + select CPU_V6 bool "i.MX31" config ARCH_IMX35 bool "i.MX35" + select CPU_V6 select ARCH_HAS_FEC_IMX endchoice -- 1.6.6 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 03/12] cache functions from kernel 2010-01-25 7:32 ` [PATCH 03/12] cache functions from kernel Sascha Hauer 2010-01-25 7:32 ` [PATCH 04/12] remove unused NETCONSOLE stuff Sascha Hauer @ 2010-01-25 8:57 ` Uwe Kleine-König 1 sibling, 0 replies; 15+ messages in thread From: Uwe Kleine-König @ 2010-01-25 8:57 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox Hello Sascha, On Mon, Jan 25, 2010 at 08:32:21AM +0100, Sascha Hauer wrote: > void mmu_enable(void) > { > asm volatile ( > - "mrc p15, 0, r1, c1, c0, 0;" > - "orr r1, r1, #0x0007;" /* enable MMU + Dcache */ > - "mcr p15, 0, r1, c1, c0, 0" > + "bl __mmu_cache_on;" > : > : > - : "r1" /* Clobber list */ > + : "r0", "r1", "r2", "r3", "r6", "r10", "r12" You should add "cc" and "mem" to the list of clobbered registers. > ); > } > > @@ -67,28 +65,13 @@ void mmu_enable(void) > */ > void mmu_disable(void) > { > + > asm volatile ( > - "nop; " > - "nop; " > - "nop; " > - "nop; " > - "nop; " > - "nop; " > - /* test, clean and invalidate cache */ > - "1: mrc p15, 0, r15, c7, c14, 3;" > - " bne 1b;" > - " mov pc, lr;" > - " mov r0, #0x0;" > - " mcr p15, 0, r0, c7, c10, 4;" /* drain the write buffer */ > - " mcr p15, 0, r1, c7, c6, 0;" /* clear data cache */ > - " mrc p15, 0, r1, c1, c0, 0;" > - " bic r1, r1, #0x0007;" /* disable MMU + DCache */ > - " mcr p15, 0, r1, c1, c0, 0;" > - " mcr p15, 0, r0, c7, c6, 0;" /* flush d-cache */ > - " mcr p15, 0, r0, c8, c7, 0;" /* flush i+d-TLBs */ > + "bl __mmu_cache_flush;" > + "bl __mmu_cache_off;" > : > : > - : "r0" /* Clobber list */ > + : "r0", "r1", "r2", "r3", "r6", "r10", "r12" ditto Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Patches for -next 2010-01-25 7:32 Patches for -next Sascha Hauer 2010-01-25 7:32 ` [PATCH 01/12] remove unused cdp code Sascha Hauer @ 2010-01-25 7:39 ` Sascha Hauer 1 sibling, 0 replies; 15+ messages in thread From: Sascha Hauer @ 2010-01-25 7:39 UTC (permalink / raw) To: barebox On Mon, Jan 25, 2010 at 08:32:18AM +0100, Sascha Hauer wrote: > Hi all, > > Here are some patches to review for -next > > Sascha And here's a changelog for these patches. Damn, it's too early for me :) Sascha The following changes since commit 0dde20da20411bf4dcd5593601d2f36e9ba04f66: Peter Korsgaard (1): documentation: It's U-Boot that doesn't have getopt, not Barebox are available in the git repository at: git://git.pengutronix.de/git/barebox.git pu Sascha Hauer (12): remove unused cdp code remove obsolete comment cache functions from kernel remove unused NETCONSOLE stuff remove unused file common/flash.c Move tftp/nfs specific code to net/* remove typedef cmd_tbl_t and replace it with struct command pcm043: initialize cpufreq to 532MHz replace ET_DEBUG with pr_debug put only once used function inline add armv6 support to the konfig system i.MX: select armv6 for i.MX31/35 arch/arm/cpu/Kconfig | 8 ++ arch/arm/cpu/Makefile | 6 +- arch/arm/cpu/cache-armv4.S | 137 ++++++++++++++++++++++++++ arch/arm/cpu/cache-armv6.S | 131 +++++++++++++++++++++++++ arch/arm/cpu/cache-armv7.S | 185 ++++++++++++++++++++++++++++++++++++ arch/arm/cpu/cpu.c | 2 +- arch/arm/cpu/cpuinfo.c | 2 +- arch/arm/cpu/mmu.c | 29 +----- arch/arm/lib/armlinux.c | 4 +- arch/arm/mach-imx/Kconfig | 2 + arch/arm/mach-imx/clko.c | 2 +- arch/arm/mach-imx/speed.c | 2 +- arch/arm/mach-netx/generic.c | 2 +- arch/ppc/mach-mpc5xxx/interrupts.c | 2 +- board/ipe337/cmd_alternate.c | 2 +- board/pcm043/lowlevel_init.S | 2 +- board/pcm043/pcm043.c | 2 +- commands/bmp.c | 2 +- commands/bootm.c | 6 +- commands/cat.c | 2 +- commands/cd.c | 2 +- commands/clear.c | 2 +- commands/cp.c | 2 +- commands/crc.c | 2 +- commands/dfu.c | 2 +- commands/echo.c | 2 +- commands/edit.c | 2 +- commands/exec.c | 2 +- commands/export.c | 2 +- commands/false.c | 2 +- commands/flash.c | 4 +- commands/go.c | 2 +- commands/gpio.c | 8 +- commands/help.c | 2 +- commands/insmod.c | 2 +- commands/loadb.c | 2 +- commands/loadenv.c | 2 +- commands/loads.c | 4 +- commands/ls.c | 2 +- commands/lsmod.c | 2 +- commands/mem.c | 10 +- commands/meminfo.c | 2 +- commands/memtest.c | 2 +- commands/mkdir.c | 2 +- commands/mount.c | 2 +- commands/nand.c | 2 +- commands/net.c | 160 +------------------------------ commands/partition.c | 4 +- commands/printenv.c | 2 +- commands/pwd.c | 2 +- commands/readline.c | 2 +- commands/reginfo.c | 2 +- commands/reset.c | 2 +- commands/rm.c | 2 +- commands/rmdir.c | 2 +- commands/saveenv.c | 2 +- commands/setenv.c | 2 +- commands/sleep.c | 2 +- commands/test.c | 2 +- commands/timeout.c | 2 +- commands/true.c | 2 +- commands/umount.c | 2 +- commands/version.c | 2 +- common/command.c | 26 +++--- common/complete.c | 2 +- common/flash.c | 73 -------------- common/hush.c | 6 +- common/module.c | 4 +- drivers/nand/nand_imx.c | 2 +- drivers/nand/nand_s3c2410.c | 2 +- drivers/usb/gadget/u_serial.c | 2 +- drivers/usb/usb.c | 2 +- include/command.h | 25 ++---- include/net.h | 8 -- lib/driver.c | 2 +- net/dhcp.c | 2 +- net/net.c | 98 ++++++------------- net/nfs.c | 56 +++++++++++- net/ping.c | 6 +- net/tftp.c | 74 ++++++++++++++- 80 files changed, 734 insertions(+), 450 deletions(-) create mode 100644 arch/arm/cpu/cache-armv4.S create mode 100644 arch/arm/cpu/cache-armv6.S create mode 100644 arch/arm/cpu/cache-armv7.S delete mode 100644 common/flash.c -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2010-01-25 8:57 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-01-25 7:32 Patches for -next Sascha Hauer 2010-01-25 7:32 ` [PATCH 01/12] remove unused cdp code Sascha Hauer 2010-01-25 7:32 ` [PATCH 02/12] remove obsolete comment Sascha Hauer 2010-01-25 7:32 ` [PATCH 03/12] cache functions from kernel Sascha Hauer 2010-01-25 7:32 ` [PATCH 04/12] remove unused NETCONSOLE stuff Sascha Hauer 2010-01-25 7:32 ` [PATCH 05/12] remove unused file common/flash.c Sascha Hauer 2010-01-25 7:32 ` [PATCH 06/12] Move tftp/nfs specific code to net/* Sascha Hauer 2010-01-25 7:32 ` [PATCH 07/12] remove typedef cmd_tbl_t and replace it with struct command Sascha Hauer 2010-01-25 7:32 ` [PATCH 08/12] pcm043: initialize cpufreq to 532MHz Sascha Hauer 2010-01-25 7:32 ` [PATCH 09/12] replace ET_DEBUG with pr_debug Sascha Hauer 2010-01-25 7:32 ` [PATCH 10/12] put only once used function inline Sascha Hauer 2010-01-25 7:32 ` [PATCH 11/12] add armv6 support to the konfig system Sascha Hauer 2010-01-25 7:32 ` [PATCH 12/12] i.MX: select armv6 for i.MX31/35 Sascha Hauer 2010-01-25 8:57 ` [PATCH 03/12] cache functions from kernel Uwe Kleine-König 2010-01-25 7:39 ` Patches for -next Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox