[U-Boot] [PATCH] OMAP3: Beagle: Set pinmux conditionally for Rev C boards
The Beagle Rev C boards pull UART2 from an alternate set of balls. Signed-off-by: Steve Sakoman st...@sakoman.com Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- board/omap3/beagle/beagle.c |4 board/omap3/beagle/beagle.h | 25 + 2 files changed, 21 insertions(+), 8 deletions(-) Index: u-boot-main/board/omap3/beagle/beagle.c === --- u-boot-main.orig/board/omap3/beagle/beagle.c +++ u-boot-main/board/omap3/beagle/beagle.c @@ -130,4 +130,8 @@ int misc_init_r(void) void set_muxconf_regs(void) { MUX_BEAGLE(); + + if(beagle_revision_c) { + MUX_BEAGLE_C(); + } } Index: u-boot-main/board/omap3/beagle/beagle.h === --- u-boot-main.orig/board/omap3/beagle/beagle.h +++ u-boot-main/board/omap3/beagle/beagle.h @@ -214,14 +214,14 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC2_DAT6),(IEN | PTU | EN | M4)) /*GPIO_138*/\ MUX_VAL(CP(MMC2_DAT7),(IEN | PTU | EN | M4)) /*GPIO_139*/\ /*Bluetooth*/\ - MUX_VAL(CP(MCBSP3_DX),(IDIS | PTD | DIS | M4)) /*GPIO_140*/\ - MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M4)) /*GPIO_142*/\ - MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ - MUX_VAL(CP(MCBSP3_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_143*/\ - MUX_VAL(CP(UART2_CTS),(IEN | PTU | EN | M0)) /*UART2_CTS*/\ - MUX_VAL(CP(UART2_RTS),(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ - MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/\ - MUX_VAL(CP(UART2_RX), (IDIS | PTD | DIS | M4)) /*GPIO_147*/\ + MUX_VAL(CP(MCBSP3_DX),(IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M1)) /*UART2_TX*/\ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M1)) /*UART2_RX*/\ + MUX_VAL(CP(UART2_CTS),(IEN | PTD | DIS | M4)) /*GPIO_144*/\ + MUX_VAL(CP(UART2_RTS),(IEN | PTD | DIS | M4)) /*GPIO_145*/\ + MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/\ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M4)) /*GPIO_147*/\ /*Modem Interface */\ MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\ MUX_VAL(CP(UART1_RTS),(IDIS | PTD | DIS | M4)) /*GPIO_149*/ \ @@ -374,4 +374,13 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\ MUX_VAL(CP(SDRC_CKE0),(IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ MUX_VAL(CP(SDRC_CKE1),(IDIS | PTD | DIS | M7)) /*sdrc_cke1*/ + +#define MUX_BEAGLE_C() \ + MUX_VAL(CP(MCBSP3_DX),(IDIS | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS),(IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS),(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ + #endif ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] Support for PXA27X UDC.
Hello All, Is this going to go through the USB or through the PXA tree? USB I guess But the patch will need to rebase due to the last usb dev USB is fine with me. Kind Regards, Remy ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/5] mmc: clean up help texts
Remove some repeated words and superfluous newlines in the mmc command help entries. Signed-off-by: Rabin Vincent ra...@rab.in --- common/cmd_mmc.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index f1fa32f..bd55ff1 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -135,8 +135,9 @@ int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -U_BOOT_CMD(mmcinfo, 2, 0, do_mmcinfo, mmcinfo dev num-- display MMC info\n, - NULL); +U_BOOT_CMD(mmcinfo,2, 0, do_mmcinfo, + print MMC information, + dev num\n); int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -218,8 +219,8 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD( mmc, 6, 1, do_mmcops, MMC sub system, - mmc read device num addr blk# cnt\n + read device num addr blk# cnt\n mmc write device num addr blk# cnt\n mmc rescan device num\n - mmc list - lists available devices\n); + mmc list - list available devices\n); #endif -- 1.6.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/5] mmc: check find_mmc_device return value
find_mmc_device returns NULL if an invalid device number is specified. Check for this to avoid dereferencing NULL pointers. Signed-off-by: Rabin Vincent ra...@rab.in --- common/cmd_mmc.c |9 + drivers/mmc/mmc.c |2 +- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index bd55ff1..039fe59 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -149,6 +149,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) int dev = simple_strtoul(argv[2], NULL, 10); struct mmc *mmc = find_mmc_device(dev); + if (!mmc) + return 1; + mmc_init(mmc); return 0; @@ -175,6 +178,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) u32 blk = simple_strtoul(argv[4], NULL, 16); struct mmc *mmc = find_mmc_device(dev); + if (!mmc) + return 1; + printf(\nMMC read: dev # %d, block # %d, count %d ... , dev, blk, cnt); @@ -197,6 +203,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) int blk = simple_strtoul(argv[4], NULL, 16); + if (!mmc) + return 1; + printf(\nMMC write: dev # %d, block # %d, count %d ... , dev, blk, cnt); diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 96186d9..50c197a 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -846,7 +846,7 @@ block_dev_desc_t *mmc_get_dev(int dev) { struct mmc *mmc = find_mmc_device(dev); - return mmc-block_dev; + return mmc ? mmc-block_dev : NULL; } int mmc_init(struct mmc *mmc) -- 1.6.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/5] mmc: use lldiv to fix arm eabi build
The generic MMC core uses direct long long divisions, which do not build with ARM EABI toolchains. Use lldiv() instead, which works everywhere. Signed-off-by: Rabin Vincent ra...@rab.in --- drivers/mmc/mmc.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 50c197a..b50c255 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -31,6 +31,7 @@ #include malloc.h #include linux/list.h #include mmc.h +#include div64.h static struct list_head mmc_devices; static int cur_dev_num = -1; @@ -155,8 +156,8 @@ int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size) char *buffer; int i; int blklen = mmc-read_bl_len; - int startblock = src / blklen; - int endblock = (src + size - 1) / blklen; + int startblock = lldiv(src, mmc-read_bl_len); + int endblock = lldiv(src + size - 1, mmc-read_bl_len); int err = 0; /* Make a buffer big enough to hold all the blocks we might read */ @@ -789,7 +790,7 @@ int mmc_startup(struct mmc *mmc) mmc-block_dev.lun = 0; mmc-block_dev.type = 0; mmc-block_dev.blksz = mmc-read_bl_len; - mmc-block_dev.lba = mmc-capacity/mmc-read_bl_len; + mmc-block_dev.lba = lldiv(mmc-capacity, mmc-read_bl_len); sprintf(mmc-block_dev.vendor,Man %02x%02x%02x Snr %02x%02x%02x%02x, mmc-cid[0], mmc-cid[1], mmc-cid[2], mmc-cid[9], mmc-cid[10], mmc-cid[11], mmc-cid[12]); -- 1.6.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/5] mmc: fix response decoding on little endian
The mmc code defines the response as an array of chars. However, it access the response bytes both as (i) an array of four uints (with casts) and (ii) as individual chars. The former case is used more often, including by the driver when it assigns the response. The char-wise accesses are broken on little endian systems because they assume that the bytes in the uints are in big endian byte order. This patch fixes this by changing the response to be an array of four uints and replacing the char-wise accesses with equivalent uint-wise accesses. Signed-off-by: Rabin Vincent ra...@rab.in --- drivers/mmc/mmc.c | 20 ++-- include/mmc.h |6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index b50c255..1c83cc7 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -651,7 +651,7 @@ int mmc_startup(struct mmc *mmc) mmc-csd[3] = ((uint *)(cmd.response))[3]; if (mmc-version == MMC_VERSION_UNKNOWN) { - int version = (cmd.response[0] 2) 0xf; + int version = (cmd.response[0] 26) 0xf; switch (version) { case 0: @@ -676,8 +676,8 @@ int mmc_startup(struct mmc *mmc) } /* divide frequency by 10, since the mults are 10x bigger */ - freq = fbase[(cmd.response[3] 0x7)]; - mult = multipliers[((cmd.response[3] 3) 0xf)]; + freq = fbase[(cmd.response[0] 0x7)]; + mult = multipliers[((cmd.response[0] 3) 0xf)]; mmc-tran_speed = freq * mult; @@ -791,13 +791,13 @@ int mmc_startup(struct mmc *mmc) mmc-block_dev.type = 0; mmc-block_dev.blksz = mmc-read_bl_len; mmc-block_dev.lba = lldiv(mmc-capacity, mmc-read_bl_len); - sprintf(mmc-block_dev.vendor,Man %02x%02x%02x Snr %02x%02x%02x%02x, - mmc-cid[0], mmc-cid[1], mmc-cid[2], - mmc-cid[9], mmc-cid[10], mmc-cid[11], mmc-cid[12]); - sprintf(mmc-block_dev.product,%c%c%c%c%c, mmc-cid[3], - mmc-cid[4], mmc-cid[5], mmc-cid[6], mmc-cid[7]); - sprintf(mmc-block_dev.revision,%d.%d, mmc-cid[8] 4, - mmc-cid[8] 0xf); + sprintf(mmc-block_dev.vendor, Man %06x Snr %08x, mmc-cid[0] 8, + (mmc-cid[2] 8) | (mmc-cid[3] 24)); + sprintf(mmc-block_dev.product, %c%c%c%c%c, mmc-cid[0] 0xff, + (mmc-cid[1] 24), (mmc-cid[1] 16) 0xff, + (mmc-cid[1] 8) 0xff, mmc-cid[1] 0xff); + sprintf(mmc-block_dev.revision, %d.%d, mmc-cid[2] 28, + (mmc-cid[2] 24) 0xf); init_part(mmc-block_dev); return 0; diff --git a/include/mmc.h b/include/mmc.h index b9b27ba..229d494 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -91,7 +91,7 @@ #define MMC_HS_TIMING 0x0100 #define MMC_HS_52MHZ 0x2 -#define OCR_BUSY 0x80 +#define OCR_BUSY 0x8000 #define OCR_HCS0x4000 #define MMC_VDD_165_1950x0080 /* VDD voltage 1.65 - 1.95 */ @@ -223,7 +223,7 @@ struct mmc_cmd { ushort cmdidx; uint resp_type; uint cmdarg; - char response[18]; + uint response[4]; uint flags; }; @@ -253,7 +253,7 @@ struct mmc { uint ocr; uint scr[2]; uint csd[4]; - char cid[16]; + uint cid[4]; ushort rca; uint tran_speed; uint read_bl_len; -- 1.6.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/5] mmc: drop unnecessary casts
Now that response is a uint, we can drop all the casts. Signed-off-by: Rabin Vincent ra...@rab.in --- drivers/mmc/fsl_esdhc.c | 10 +- drivers/mmc/mmc.c | 20 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 0ba45cd..8274af5 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -206,12 +206,12 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) cmdrsp2 = in_be32(regs-cmdrsp2); cmdrsp1 = in_be32(regs-cmdrsp1); cmdrsp0 = in_be32(regs-cmdrsp0); - ((uint *)(cmd-response))[0] = (cmdrsp3 8) | (cmdrsp2 24); - ((uint *)(cmd-response))[1] = (cmdrsp2 8) | (cmdrsp1 24); - ((uint *)(cmd-response))[2] = (cmdrsp1 8) | (cmdrsp0 24); - ((uint *)(cmd-response))[3] = (cmdrsp0 8); + cmd-response[0] = (cmdrsp3 8) | (cmdrsp2 24); + cmd-response[1] = (cmdrsp2 8) | (cmdrsp1 24); + cmd-response[2] = (cmdrsp1 8) | (cmdrsp0 24); + cmd-response[3] = (cmdrsp0 8); } else - ((uint *)(cmd-response))[0] = in_be32(regs-cmdrsp0); + cmd-response[0] = in_be32(regs-cmdrsp0); /* Wait until all of the blocks are transferred */ if (data) { diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1c83cc7..b4814d2 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -292,7 +292,7 @@ sd_send_op_cond(struct mmc *mmc) if (mmc-version != SD_VERSION_2) mmc-version = SD_VERSION_1_0; - mmc-ocr = ((uint *)(cmd.response))[0]; + mmc-ocr = cmd.response[0]; mmc-high_capacity = ((mmc-ocr OCR_HCS) == OCR_HCS); mmc-rca = 0; @@ -327,7 +327,7 @@ int mmc_send_op_cond(struct mmc *mmc) return UNUSABLE_ERR; mmc-version = MMC_VERSION_UNKNOWN; - mmc-ocr = ((uint *)(cmd.response))[0]; + mmc-ocr = cmd.response[0]; mmc-high_capacity = ((mmc-ocr OCR_HCS) == OCR_HCS); mmc-rca = 0; @@ -632,7 +632,7 @@ int mmc_startup(struct mmc *mmc) return err; if (IS_SD(mmc)) - mmc-rca = (((uint *)(cmd.response))[0] 16) 0x; + mmc-rca = (cmd.response[0] 16) 0x; /* Get the Card-Specific Data */ cmd.cmdidx = MMC_CMD_SEND_CSD; @@ -645,10 +645,10 @@ int mmc_startup(struct mmc *mmc) if (err) return err; - mmc-csd[0] = ((uint *)(cmd.response))[0]; - mmc-csd[1] = ((uint *)(cmd.response))[1]; - mmc-csd[2] = ((uint *)(cmd.response))[2]; - mmc-csd[3] = ((uint *)(cmd.response))[3]; + mmc-csd[0] = cmd.response[0]; + mmc-csd[1] = cmd.response[1]; + mmc-csd[2] = cmd.response[2]; + mmc-csd[3] = cmd.response[3]; if (mmc-version == MMC_VERSION_UNKNOWN) { int version = (cmd.response[0] 26) 0xf; @@ -681,12 +681,12 @@ int mmc_startup(struct mmc *mmc) mmc-tran_speed = freq * mult; - mmc-read_bl_len = 1 uint *)(cmd.response))[1] 16) 0xf); + mmc-read_bl_len = 1 ((cmd.response[1] 16) 0xf); if (IS_SD(mmc)) mmc-write_bl_len = mmc-read_bl_len; else - mmc-write_bl_len = 1 uint *)(cmd.response))[3] 22) 0xf); + mmc-write_bl_len = 1 ((cmd.response[3] 22) 0xf); if (mmc-high_capacity) { csize = (mmc-csd[1] 0x3f) 16 @@ -819,7 +819,7 @@ int mmc_send_if_cond(struct mmc *mmc) if (err) return err; - if uint *)(cmd.response))[0] 0xff) != 0xaa) + if ((cmd.response[0] 0xff) != 0xaa) return UNUSABLE_ERR; else mmc-version = SD_VERSION_2; -- 1.6.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] make MODEM SUPPORT generic instead of duplicate it
On 00:32 Thu 02 Apr , Wolfgang Denk wrote: Dear Jean-Christophe PLAGNIOL-VILLARD, In message 1236447277-18574-1-git-send-email-plagn...@jcrosoft.com you wrote: Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- common/Makefile |1 + common/modem.c | 123 +++ lib_arm/board.c | 99 lib_ppc/board.c | 97 --- 4 files changed, 124 insertions(+), 196 deletions(-) create mode 100644 common/modem.c ... diff --git a/common/modem.c b/common/modem.c new file mode 100644 index 000..27e164a --- /dev/null +++ b/common/modem.c ... +/* called from main loop (common/main.c) */ +/* 'inline' - We have to do it fast */ +static inline void mdm_readline(char *buf, int bufsiz) How is this supposed to work? You cannot call a static function from another source file. this function is only use in this file actualy the code is lib_arm/board.c and lib_ppc/board.c is identical I just move it to modem.c the only function use outiside of this file is mdm_init Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sf: atmel: implement power-of-two write/erase funcs
On Saturday 04 April 2009 09:39:14 Wolfgang Denk wrote: In message Mike Frysinger wrote: From: Todor I Mollov tmol...@ucsd.edu Signed-off-by: Todor I Mollov tmol...@ucsd.edu Signed-off-by: Mike Frysinger vap...@gentoo.org CC: Haavard Skinnemoen haavard.skinnem...@atmel.com --- drivers/mtd/spi/atmel.c | 139 +++ 1 files changed, 139 insertions(+), 0 deletions(-) I understand this is not a bug fix but new stuff, i. e. for the next release? correct. i'm posting it for feedback in case someone notices a problem, or the atmel guys want something different. i'll keep it in my sf branch for next release so it doesnt get lost. -mike Sorry for the terminology mix-up there. I guess I labeled it as a bug fix since, prior to the patch, attempting to write or erase and at45 flash in powers-of-two mode caused u-boot to crash due to null function pointer call. In my head things that lead to crashes get labeled as bugs. This occurred in both 2009.01 and 2009.03. It would probably be a good idea to implement a check in the upper level of the spi flash driver to handle such issues and report them gracefully ;). (It definitely left me scratching my head for a while there until I familiarized myself with the driver structure a bit.) -Todor ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2 V5] bdinfo: coding style cleanup
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- V4 - V5 Rebase common/cmd_bdinfo.c |4 +++ lib_arm/bdinfo.c|4 +- lib_avr32/bdinfo.c | 16 +++--- lib_blackfin/bdinfo.c | 24 ++-- lib_i386/bdinfo.c | 16 +++--- lib_m68k/bdinfo.c | 32 ++-- lib_microblaze/bdinfo.c | 19 --- lib_mips/bdinfo.c | 16 +++--- lib_nios/bdinfo.c | 14 ++-- lib_nios2/bdinfo.c | 18 +++--- lib_ppc/bdinfo.c| 54 +++--- lib_sh/bdinfo.c | 16 +++--- lib_sparc/bdinfo.c | 20 13 files changed, 129 insertions(+), 124 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 2609854..1a74f1c 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -59,13 +59,17 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) void print_eth(int idx) { char name[10], *val; + if (idx) sprintf(name, eth%iaddr, idx); else strcpy(name, ethaddr); + val = getenv(name); + if (!val) val = (not set); + printf(%-12s= %s\n, name, val); } diff --git a/lib_arm/bdinfo.c b/lib_arm/bdinfo.c index 7065bbb..d706530 100644 --- a/lib_arm/bdinfo.c +++ b/lib_arm/bdinfo.c @@ -36,7 +36,7 @@ void arch_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num (env_t, (ulong)bd-bi_env); print_num (boot_params, (ulong)bd-bi_boot_params); - for (i=0; iCONFIG_NR_DRAM_BANKS; ++i) { + for (i = 0; i CONFIG_NR_DRAM_BANKS; ++i) { print_num(DRAM bank, i); print_num(- start, bd-bi_dram[i].start); print_num(- size,bd-bi_dram[i].size); @@ -44,7 +44,7 @@ void arch_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #if defined(CONFIG_CMD_NET) print_eth(0); - printf (ip_addr = %pI4\n, bd-bi_ip_addr); + printf (ip_addr = %pI4\n, bd-bi_ip_addr); #endif printf (baudrate= %d bps\n, bd-bi_baudrate); } diff --git a/lib_avr32/bdinfo.c b/lib_avr32/bdinfo.c index fac5b33..eae4b20 100644 --- a/lib_avr32/bdinfo.c +++ b/lib_avr32/bdinfo.c @@ -31,14 +31,14 @@ void arch_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { bd_t *bd = gd-bd; - print_num (boot_params, (ulong)bd-bi_boot_params); - print_num (memstart, (ulong)bd-bi_memstart); - print_lnum (memsize, (u64)bd-bi_memsize); - print_num (flashstart,(ulong)bd-bi_flashstart); - print_num (flashsize, (ulong)bd-bi_flashsize); - print_num (flashoffset, (ulong)bd-bi_flashoffset); + print_num(boot_params,(ulong)bd-bi_boot_params); + print_num(memstart, (ulong)bd-bi_memstart); + print_lnum(memsize, (u64)bd-bi_memsize); + print_num(flashstart, (ulong)bd-bi_flashstart); + print_num(flashsize, (ulong)bd-bi_flashsize); + print_num(flashoffset,(ulong)bd-bi_flashoffset); print_eth(0); - printf (ip_addr = %pI4\n, bd-bi_ip_addr); - printf (baudrate= %d bps\n, bd-bi_baudrate); + printf(ip_addr = %pI4\n, bd-bi_ip_addr); + printf(baudrate= %d bps\n, bd-bi_baudrate); } diff --git a/lib_blackfin/bdinfo.c b/lib_blackfin/bdinfo.c index c5a4ed0..7395bf7 100644 --- a/lib_blackfin/bdinfo.c +++ b/lib_blackfin/bdinfo.c @@ -32,19 +32,19 @@ void arch_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) bd_t *bd = gd-bd; char buf[32]; - printf(U-Boot = %s\n, bd-bi_r_version); - printf(CPU = %s\n, bd-bi_cpu); - printf(Board = %s\n, bd-bi_board_name); - print_str(VCO, strmhz(buf, bd-bi_vco)); - print_str(CCLK,strmhz(buf, bd-bi_cclk)); - print_str(SCLK,strmhz(buf, bd-bi_sclk)); + printf(U-Boot = %s\n,bd-bi_r_version); + printf(CPU = %s\n,bd-bi_cpu); + printf(Board = %s\n,bd-bi_board_name); + print_str(VCO,strmhz(buf, bd-bi_vco)); + print_str(CCLK, strmhz(buf, bd-bi_cclk)); + print_str(SCLK, strmhz(buf, bd-bi_sclk)); - print_num(boot_params, (ulong)bd-bi_boot_params); - print_num(memstart,(ulong)bd-bi_memstart); - print_lnum(memsize,(u64)bd-bi_memsize); - print_num(flashstart, (ulong)bd-bi_flashstart); - print_num(flashsize, (ulong)bd-bi_flashsize); - print_num(flashoffset, (ulong)bd-bi_flashoffset); + print_num(boot_params,(ulong)bd-bi_boot_params); + print_num(memstart, (ulong)bd-bi_memstart); + print_lnum(memsize, (u64)bd-bi_memsize); +
[U-Boot] [PATCH 1/2 V5] cmd_bdinfo: move implementation to arch instead of common
introduce 3 new weak functions board_bdinfo, cpu_bdinfo and soc_bdinfo to allow board, cpu and soc to print more information Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Acked-by: Mike Frysinger vap...@gentoo.org Acked-by: Haavard Skinnemoen haavard.skinnem...@atmel.com --- V4 - V5 Rebase common/cmd_bdinfo.c | 464 --- include/bdinfo.h| 49 + lib_arm/Makefile|1 + lib_arm/bdinfo.c| 50 + lib_avr32/Makefile |1 + lib_avr32/bdinfo.c | 44 + lib_blackfin/Makefile |1 + lib_blackfin/bdinfo.c | 52 ++ lib_i386/Makefile |1 + lib_i386/bdinfo.c | 44 + lib_m68k/Makefile |1 + lib_m68k/bdinfo.c | 72 lib_microblaze/Makefile |1 + lib_microblaze/bdinfo.c | 47 + lib_mips/Makefile |1 + lib_mips/bdinfo.c | 44 + lib_nios/Makefile |1 + lib_nios/bdinfo.c | 43 + lib_nios2/Makefile |1 + lib_nios2/bdinfo.c | 51 + lib_ppc/Makefile|1 + lib_ppc/bdinfo.c| 104 +++ lib_sh/Makefile |1 + lib_sh/bdinfo.c | 44 + lib_sparc/Makefile | 13 +- lib_sparc/bdinfo.c | 58 ++ 26 files changed, 798 insertions(+), 392 deletions(-) rewrite common/cmd_bdinfo.c (89%) create mode 100644 include/bdinfo.h create mode 100644 lib_arm/bdinfo.c create mode 100644 lib_avr32/bdinfo.c create mode 100644 lib_blackfin/bdinfo.c create mode 100644 lib_i386/bdinfo.c create mode 100644 lib_m68k/bdinfo.c create mode 100644 lib_microblaze/bdinfo.c create mode 100644 lib_mips/bdinfo.c create mode 100644 lib_nios/bdinfo.c create mode 100644 lib_nios2/bdinfo.c create mode 100644 lib_ppc/bdinfo.c create mode 100644 lib_sh/bdinfo.c create mode 100644 lib_sparc/bdinfo.c diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c dissimilarity index 89% index b230924..2609854 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -1,388 +1,76 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk, DENX Software Engineering, w...@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 - */ - -/* - * Boot support - */ -#include common.h -#include command.h - -DECLARE_GLOBAL_DATA_PTR; - -static void print_num(const char *, ulong); - -#if !defined(CONFIG_ARM) || defined(CONFIG_CMD_NET) -static void print_eth(int idx); -#endif - -#ifndef CONFIG_ARM /* PowerPC and other */ -static void print_lnum(const char *, u64); - -#ifdef CONFIG_PPC -static void print_str(const char *, const char *); - -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) -{ - bd_t *bd = gd-bd; - char buf[32]; - -#ifdef DEBUG - print_num (bd address,(ulong)bd ); -#endif - print_num (memstart, bd-bi_memstart ); - print_lnum (memsize, bd-bi_memsize ); - print_num (flashstart,bd-bi_flashstart ); - print_num (flashsize, bd-bi_flashsize); - print_num (flashoffset, bd-bi_flashoffset ); - print_num (sramstart, bd-bi_sramstart); - print_num (sramsize, bd-bi_sramsize ); -#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || \ -defined(CONFIG_8260) || defined(CONFIG_E500) - print_num (immr_base, bd-bi_immr_base); -#endif - print_num (bootflags, bd-bi_bootflags); -#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ -defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \ -defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ -defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||\ -defined(CONFIG_440SP) || defined(CONFIG_440SPE) - print_str (procfreq, strmhz(buf, bd-bi_procfreq)); - print_str (plb_busfreq, strmhz(buf, bd-bi_plb_busfreq)); -#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \ -defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE) || \ -defined(CONFIG_440EPX) || defined(CONFIG_440GRX) - print_str (pci_busfreq, strmhz(buf, bd-bi_pci_busfreq)); -#endif -#else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP,
[U-Boot] [PATCH 2/3] arm: clean cache management
unify arm cache management except for non standard cache as ARM7TDMI Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- Comment fix Best Regards, J. board/armltd/integratorap/split_by_variant.sh | 18 - cpu/arm1136/cpu.c | 46 +++- cpu/arm1176/cpu.c | 57 +-- cpu/arm720t/cpu.c | 74 +++--- cpu/arm920t/cpu.c | 73 +++ cpu/arm925t/cpu.c | 45 +++- cpu/arm926ejs/cpu.c | 72 +++--- cpu/arm946es/cpu.c| 48 +++- cpu/arm_cortexa8/cpu.c| 39 -- cpu/arm_intcm/cpu.c | 15 cpu/ixp/cpu.c | 64 +++- cpu/lh7a40x/cpu.c | 70 +++--- cpu/pxa/cpu.c | 62 ++- cpu/sa1100/cpu.c | 58 ++ include/configs/B2.h |1 + include/configs/assabet.h |2 + include/configs/cerf250.h |3 + include/configs/cradle.h |3 + include/configs/csb226.h |4 + include/configs/delta.h |3 + include/configs/dnp1110.h |2 + include/configs/evb4510.h |1 + include/configs/gcplus.h |2 + include/configs/innokom.h |4 + include/configs/lart.h|2 + include/configs/logodl.h |4 + include/configs/lubbock.h |3 + include/configs/pleb2.h |3 + include/configs/pxa255_idp.h |3 + include/configs/shannon.h |2 + include/configs/trizepsiv.h |3 + include/configs/wepep250.h|2 + include/configs/xaeniax.h |3 + include/configs/xm250.h |3 + include/configs/xsengine.h|3 + include/configs/zylonite.h|3 + lib_arm/Makefile |3 + cpu/arm926ejs/cpu.c = lib_arm/cache-cp15.c | 100 ++--- 38 files changed, 219 insertions(+), 684 deletions(-) copy cpu/arm926ejs/cpu.c = lib_arm/cache-cp15.c (59%) diff --git a/board/armltd/integratorap/split_by_variant.sh b/board/armltd/integratorap/split_by_variant.sh index 51dc53f..2c9fe2e 100755 --- a/board/armltd/integratorap/split_by_variant.sh +++ b/board/armltd/integratorap/split_by_variant.sh @@ -84,8 +84,8 @@ else esac fi -if [ $cpu = arm_intcm ] -then +case $cpu in + arm_intcm) echo /* Core module undefined/not ported */tmp.fil echo #define CONFIG_ARM_INTCM 1tmp.fil echo -n #undef CONFIG_CM_MULTIPLE_SSRAMtmp.fil @@ -102,7 +102,19 @@ then echoinitialization reg */ tmp.fil echo -n #undef CONFIG_CM_TCRAM tmp.fil echo /* CM may not have TCRAM */ tmp.fil -fi + echo -n /* May not be processor tmp.fil + echowithout cache support */ tmp.fil + echo#define CONFIG_SYS_NO_ICACHE 1 tmp.fil + echo#define CONFIG_SYS_NO_DCACHE 1 tmp.fil + ;; + + arm720t) + echo -n /* May not be processor tmp.fil + echowithout cache support */ tmp.fil + echo#define CONFIG_SYS_NO_ICACHE 1 tmp.fil + echo#define CONFIG_SYS_NO_DCACHE 1 tmp.fil + ;; +esac mkdir -p ${obj}include mkdir -p ${obj}board/armltd/integratorap diff --git a/cpu/arm1136/cpu.c b/cpu/arm1136/cpu.c index 0abe307..78f6e92 100644 --- a/cpu/arm1136/cpu.c +++ b/cpu/arm1136/cpu.c @@ -39,13 +39,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif -static void cp_delay (void) -{ - volatile int i; - - /* Many OMAP regs need at least 2 nops */ - for (i = 0; i 100; i++); -} +static void cache_flush(void); int cpu_init (void) { @@ -68,8 +62,6 @@ int cleanup_before_linux (void) * we turn off caches etc ... */ - unsigned long i; - disable_interrupts (); #ifdef CONFIG_LCD @@ -83,15 +75,12 @@ int cleanup_before_linux (void) #endif /* turn off I/D-cache */ - asm (mrc p15, 0, %0, c1, c0, 0:=r (i)); - i = ~(CR_C | CR_I); - asm (mcr p15, 0, %0, c1, c0, 0: :r (i)); - + icache_disable(); + dcache_disable(); /* flush I/D-cache */ - i = 0; - asm (mcr p15, 0, %0, c7, c7, 0: :r (i)); /* invalidate both caches and flush btb */ - asm (mcr p15, 0, %0,
[U-Boot] ARM Pull Request
Hi Wolfgang, Please pull The following changes since commit 23e4af49e066a53cd3e3659b68ef90572d88de84: Guennadi Liakhovetski (1): ARM: add the imx31_phycore_eet target to MAINTAINERS are available in the git repository at: git://git.denx.de/u-boot-arm.git master Dirk Behme (1): OMAP3: Update Overo pin mux for new expansion board Jean-Christophe PLAGNIOL-VILLARD (4): arm: update co-processor 15 access arm: clean cache management arm: unify reset command integratorap: fix PCI support Kyungmin Park (1): Move machine specific code to board at s3c64xx (v2) Minkyu Kang (1): s3c64xx: fix the wrong gpio offset Sanjeev Premi (1): OMAP: Fix compile issue Tom Rix (2): OMAP3 Fix multiline formatting in board init files. ZOOM1 Remove legacy NAND defines board/armltd/integratorap/split_by_variant.sh | 18 +++- board/omap3/beagle/beagle.c | 20 ++-- board/omap3/evm/evm.c | 16 ++-- board/omap3/overo/overo.c | 12 +- board/omap3/overo/overo.h |9 +- board/omap3/pandora/pandora.c | 12 +- board/omap3/zoom1/zoom1.c | 12 +- board/samsung/smdk6400/lowlevel_init.S|7 ++ cpu/arm1136/cpu.c | 90 ++ cpu/arm1176/cpu.c | 103 + cpu/arm1176/s3c64xx/cpu_init.S|7 -- cpu/arm720t/cpu.c | 120 +++- cpu/arm920t/cpu.c | 124 ++-- cpu/arm925t/cpu.c | 96 ++- cpu/arm926ejs/cpu.c | 125 ++-- cpu/arm946es/cpu.c| 101 ++-- cpu/arm_cortexa8/cpu.c| 82 + cpu/arm_cortexa8/omap3/board.c|2 +- cpu/arm_intcm/cpu.c | 25 - cpu/ixp/cpu.c | 83 ++-- cpu/lh7a40x/cpu.c | 121 ++-- cpu/pxa/cpu.c | 81 ++-- cpu/s3c44b0/cpu.c |9 -- cpu/sa1100/cpu.c | 81 ++-- include/asm-arm/system.h | 84 + include/configs/B2.h |1 + include/configs/assabet.h |2 + include/configs/cerf250.h |3 + include/configs/cradle.h |3 + include/configs/csb226.h |4 + include/configs/delta.h |3 + include/configs/dnp1110.h |2 + include/configs/evb4510.h |1 + include/configs/gcplus.h |2 + include/configs/innokom.h |4 + include/configs/integratorap.h|4 +- include/configs/lart.h|2 + include/configs/logodl.h |4 + include/configs/lubbock.h |3 + include/configs/omap3_zoom1.h | 17 include/configs/pleb2.h |3 + include/configs/pxa255_idp.h |3 + include/configs/shannon.h |2 + include/configs/trizepsiv.h |3 + include/configs/wepep250.h|2 + include/configs/xaeniax.h |3 + include/configs/xm250.h |3 + include/configs/xsengine.h|3 + include/configs/zylonite.h|3 + include/s3c6400.h | 11 ++- lib_arm/Makefile |4 + lib_arm/cache-cp15.c | 120 lib_arm/reset.c | 53 +++ 53 files changed, 501 insertions(+), 1207 deletions(-) create mode 100644 include/asm-arm/system.h create mode 100644 lib_arm/cache-cp15.c create mode 100644 lib_arm/reset.c Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] OMAP3: Beagle: Set pinmux conditionally for Rev C boards
On 08:46 Sun 05 Apr , Dirk Behme wrote: The Beagle Rev C boards pull UART2 from an alternate set of balls. Signed-off-by: Steve Sakoman st...@sakoman.com Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- board/omap3/beagle/beagle.c |4 board/omap3/beagle/beagle.h | 25 + 2 files changed, 21 insertions(+), 8 deletions(-) Index: u-boot-main/board/omap3/beagle/beagle.c === --- u-boot-main.orig/board/omap3/beagle/beagle.c +++ u-boot-main/board/omap3/beagle/beagle.c @@ -130,4 +130,8 @@ int misc_init_r(void) void set_muxconf_regs(void) { MUX_BEAGLE(); + + if(beagle_revision_c) { please add a space between the if and '(' + MUX_BEAGLE_C(); + } } Index: u-boot-main/board/omap3/beagle/beagle.h === --- u-boot-main.orig/board/omap3/beagle/beagle.h +++ u-boot-main/board/omap3/beagle/beagle.h @@ -214,14 +214,14 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ /*Bluetooth*/\ - MUX_VAL(CP(MCBSP3_DX), (IDIS | PTD | DIS | M4)) /*GPIO_140*/\ - MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M4)) /*GPIO_142*/\ - MUX_VAL(CP(MCBSP3_CLKX),(IDIS | PTD | DIS | M4)) /*GPIO_141*/\ - MUX_VAL(CP(MCBSP3_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_143*/\ snip +#define MUX_BEAGLE_C() \ + MUX_VAL(CP(MCBSP3_DX), (IDIS | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX),(IDIS | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ please wait Tom Rix gpio patch move to this API Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] OMAP3: Remove legacy NAND defines
On 07:38 Sun 05 Apr , Dirk Behme wrote: Remove remaining legacy NAND defines for Beagle, EVM, Overo and Pandora. Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- For Zoom1 it was already removed by http://lists.denx.de/pipermail/u-boot/2009-April/050150.html Scott can I apply this one or will you? Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] OMAP3: Update Overo pin mux for new expansion board
On 21:15 Mon 30 Mar , Dirk Behme wrote: A new Overo expansion board uses GPIO 14, 21, 22 and 23 for LED's and switches. This patch changes the pinmux configuration for those pins. They were previously set up for unused MMC3_DAT4-7. Signed-off-by: Steve Sakoman st...@sakoman.com Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- Apply Changes in v2: - Add Dirk's Signed-off-by - Rebase against U-Boot mainline commit 2344bb8de2354101a8264c2123303c9d8d2aed3c 'inka4x0: Use proper accessor macros for memory mapped registers.' when you rebase a code you MUST let the orignal Author as patch Author please use stgit or any other tools for this Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] at91: Add support for esd MEESC board
On 10:24 Fri 27 Mar , Daniel Gorsulowski wrote: This patch adds support for MEESC board from esd gmbh. The MEESC is based on an Atmel AT91SAM9263 SoC. Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu --- please rebase your patch against git://git.denx.de/u-boot-at91.git branch clock Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM Pull Request
Dear Jean-Christophe, Jean-Christophe PLAGNIOL-VILLARD wrote: Hi Wolfgang, Please pull The following changes since commit 23e4af49e066a53cd3e3659b68ef90572d88de84: Guennadi Liakhovetski (1): ARM: add the imx31_phycore_eet target to MAINTAINERS are available in the git repository at: git://git.denx.de/u-boot-arm.git master Dirk Behme (1): OMAP3: Update Overo pin mux for new expansion board What's about http://lists.denx.de/pipermail/u-boot/2009-April/050170.html (see http://lists.denx.de/pipermail/u-boot/2009-April/050137.html too) ? Dirk ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] OMAP3: Remove legacy NAND defines
Dear Jean-Christophe, Jean-Christophe PLAGNIOL-VILLARD wrote: On 07:38 Sun 05 Apr , Dirk Behme wrote: Remove remaining legacy NAND defines for Beagle, EVM, Overo and Pandora. Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- For Zoom1 it was already removed by http://lists.denx.de/pipermail/u-boot/2009-April/050150.html Scott can I apply this one or will you? As Zoom1 was done by you, most probably it would be more consistent if you do this, too (via ARM git). Dirk ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] OMAP3: Beagle: Set pinmux conditionally for Rev C boards
Dear Jean-Christophe, Jean-Christophe PLAGNIOL-VILLARD wrote: On 08:46 Sun 05 Apr , Dirk Behme wrote: The Beagle Rev C boards pull UART2 from an alternate set of balls. Signed-off-by: Steve Sakoman st...@sakoman.com Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- board/omap3/beagle/beagle.c |4 board/omap3/beagle/beagle.h | 25 + 2 files changed, 21 insertions(+), 8 deletions(-) Index: u-boot-main/board/omap3/beagle/beagle.c === --- u-boot-main.orig/board/omap3/beagle/beagle.c +++ u-boot-main/board/omap3/beagle/beagle.c @@ -130,4 +130,8 @@ int misc_init_r(void) void set_muxconf_regs(void) { MUX_BEAGLE(); + +if(beagle_revision_c) { please add a space between the if and '(' +MUX_BEAGLE_C(); +} } Index: u-boot-main/board/omap3/beagle/beagle.h === --- u-boot-main.orig/board/omap3/beagle/beagle.h +++ u-boot-main/board/omap3/beagle/beagle.h @@ -214,14 +214,14 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ /*Bluetooth*/\ - MUX_VAL(CP(MCBSP3_DX), (IDIS | PTD | DIS | M4)) /*GPIO_140*/\ - MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M4)) /*GPIO_142*/\ - MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ - MUX_VAL(CP(MCBSP3_FSX),(IDIS | PTD | DIS | M4)) /*GPIO_143*/\ snip +#define MUX_BEAGLE_C() \ + MUX_VAL(CP(MCBSP3_DX), (IDIS | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ please wait Tom Rix gpio patch move to this API We are dealing with PinMux here, not with how GPIOs are accessed/controlled. These are two different things we talk about [1]. Dirk [1] http://lists.denx.de/pipermail/u-boot/2009-April/050234.html ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] OMAP3: Beagle: Set pinmux conditionally for Rev C boards
The Beagle Rev C boards pull UART2 from an alternate set of balls. Signed-off-by: Steve Sakoman st...@sakoman.com Signed-off-by: Dirk Behme dirk.be...@googlemail.com --- Changes in v2: - Add space between if and (beagle_revision_c) board/omap3/beagle/beagle.c |4 board/omap3/beagle/beagle.h | 25 + 2 files changed, 21 insertions(+), 8 deletions(-) Index: u-boot-main/board/omap3/beagle/beagle.c === --- u-boot-main.orig/board/omap3/beagle/beagle.c +++ u-boot-main/board/omap3/beagle/beagle.c @@ -130,4 +130,8 @@ int misc_init_r(void) void set_muxconf_regs(void) { MUX_BEAGLE(); + + if (beagle_revision_c) { + MUX_BEAGLE_C(); + } } Index: u-boot-main/board/omap3/beagle/beagle.h === --- u-boot-main.orig/board/omap3/beagle/beagle.h +++ u-boot-main/board/omap3/beagle/beagle.h @@ -214,14 +214,14 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC2_DAT6),(IEN | PTU | EN | M4)) /*GPIO_138*/\ MUX_VAL(CP(MMC2_DAT7),(IEN | PTU | EN | M4)) /*GPIO_139*/\ /*Bluetooth*/\ - MUX_VAL(CP(MCBSP3_DX),(IDIS | PTD | DIS | M4)) /*GPIO_140*/\ - MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M4)) /*GPIO_142*/\ - MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ - MUX_VAL(CP(MCBSP3_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_143*/\ - MUX_VAL(CP(UART2_CTS),(IEN | PTU | EN | M0)) /*UART2_CTS*/\ - MUX_VAL(CP(UART2_RTS),(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ - MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/\ - MUX_VAL(CP(UART2_RX), (IDIS | PTD | DIS | M4)) /*GPIO_147*/\ + MUX_VAL(CP(MCBSP3_DX),(IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M1)) /*UART2_TX*/\ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M1)) /*UART2_RX*/\ + MUX_VAL(CP(UART2_CTS),(IEN | PTD | DIS | M4)) /*GPIO_144*/\ + MUX_VAL(CP(UART2_RTS),(IEN | PTD | DIS | M4)) /*GPIO_145*/\ + MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/\ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M4)) /*GPIO_147*/\ /*Modem Interface */\ MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\ MUX_VAL(CP(UART1_RTS),(IDIS | PTD | DIS | M4)) /*GPIO_149*/ \ @@ -374,4 +374,13 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\ MUX_VAL(CP(SDRC_CKE0),(IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ MUX_VAL(CP(SDRC_CKE1),(IDIS | PTD | DIS | M7)) /*sdrc_cke1*/ + +#define MUX_BEAGLE_C() \ + MUX_VAL(CP(MCBSP3_DX),(IDIS | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR),(IDIS | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS),(IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS),(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ + #endif ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Add imls utility command
Hi Wolfgang, first of all thank you for your comments. Wolfgang Denk ha scritto: Dear Marco, In message 49d74e7b@gmail.com you wrote: Fixed a memory leak in image_verify_header function. Used the functions image_get_() from image.h. Fixed two sector boundary misalignment while reading. ... +err = ioctl(fd, MEMGETINFO, mtdinfo); +if (err 0) { +fprintf(stderr, %s: Cannot get MTD information: %s\n,cmdname,strerror(errno)); Line too long (check also rest of file). Ok. I see other files where some lines exceed 80 columns, is the limit of 80? I'll fix it. +exit(EXIT_FAILURE); +} You probably want to check for unsupported flash types, too - see example in tools/env/fw_env.c Ok. +mtdsize = mtdinfo.size; + +if (sectorsize * sectorcount != mtdsize) { +fprintf(stderr, %s: Partition size (%d) incompatible with sector size and count\n, cmdname, mtdsize); +exit(EXIT_FAILURE); +} Hmm... what happens if an image starts in one of the small sectors in a bottom boot type flash? Do you mean with an asymmetric flash layout? My first idea was manage only homogeneous situation. However you could use sectorsize equals to the smallest size and then use the offset parameter to start the searching at the bottom of the flash. ... +buf = malloc(sizeof(char)*dim); Why not just use a dynamic array on the stack? Get rid of all this malloc() and free() stuff... Do you mean a thing like this: char buf[sizeof(image_header_t)]; ? Ok no problem. +if (!buf) { +fprintf (stderr, %s: Can't allocate memory: %s\n, +cmdname, strerror(errno)); +exit(EXIT_FAILURE); +} + +if (sectoroffset != 0) +lseek(fd, sectoroffset*sectorsize, SEEK_SET); Delete these two lines and mode them into the loop... +printf(Searching\n); + +for (j = sectoroffset; j sectorcount; ++j) { i. e. add if (lseek(fd, j*sectorsize, SEEK_SET) != j*sectorsize) { error handling goes here } Mmm...I don't well understand why. For example if a sector is 128k and the header size is for example of 100 byte, after the read below, at the beginning of the cycle, the offset will be 100 byte (we say that sectoroffset is 0) and for example we don't find any image. At next cycle if I do an lseek of 1*128K, I'll get (1*128K)+100 byte as offset, at next (2*128k) + 200 byte and so on. To do this I should do an lseek after the read as lseek(fd,-readbyte,SEEK_CUR). +readbyte = read(fd, buf, dim); +if (readbyte != dim) { +fprintf(stderr, %s: Can't read from device: %s\n, +cmdname, strerror(errno)); +exit(EXIT_FAILURE); +} + +if (fdt_check_header(buf)) { +/* old-style image */ +if (image_verify_header(buf, fd)) { +found = 1; +image_print_contents((image_header_t *)buf); +} +} else { +/* FIT image */ +fit_print_contents(buf); +} + +lseek(fd, diff, SEEK_CUR); /* Align to next sector boundary */ Delete this line then, too. +void usage() +{ +fprintf (stderr, Usage:\n +%s [-o offset] -s count -c size \n + -o == number of sectors to use as offset\n + -s == number of sectors\n + -c == size of sectors\n, +cmdname); Usage message is not correct - the device argument is missing. Oops my fault. Ok. +exit (EXIT_FAILURE); +} + +static int image_verify_header(char *ptr, int fd) +{ +int len, n; +char *data; +uint32_t checksum; +image_header_t *hdr = (image_header_t *)ptr; + +if (image_get_magic(hdr) != IH_MAGIC) { +return 0; +} + +data = (char *)hdr; +len = image_get_header_size(); + +checksum = image_get_hcrc(hdr); +hdr-ih_hcrc = htonl(0);/* clear for re-calculation */ + +if (crc32(0, data, len) != checksum) { +fprintf (stderr, +%s: Maybe image found but it has bad header checksum!\n, +cmdname); +return 0; +} + +len = image_get_size(hdr); +data = malloc(len * sizeof(char)); Come on. sizeof(char) ? You must be joking. +if (!data) { +fprintf (stderr, %s: Can't allocate memory: %s\n, +cmdname, strerror(errno)); +exit(EXIT_FAILURE); +} Get rid of this malloc(), too. I can't know in this case the size of the data, to remove the malloc I have to allocate a fixed buffer of X byte, I think in this case a malloc is better. +n = read(fd, data,
[U-Boot] U-boot SDHC driver on IMX31 PDK
Hi, Is there a way to access a SD/MMC card from uboot using the FAT32 file system on the mx31 3stack/pdk board. In other words, does it have the minimal SDHC driver support . FAT32, i guess, has been an integral part of the uboot mainline since quite some time. Thanks, Alfred. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] generic nand_load.S for mx31
Hi, There is a file cpu/arm1136/mx31/nand_load.S which performs some startup functions for Copy image from flash to SDRAM etc..It does not reinitialize the DDR though. Although i haven't dugged up the details yet, could someone tell me what is the difference between nand_boot.c and nand_load.S or the assembly code is just a helper for the nand_boot api's. Thanks, Alfred. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] generic nand_load.S for mx31
2009/4/5 alfred steele alfred.jaq...@gmail.com: Hi, There is a file cpu/arm1136/mx31/nand_load.S which performs some startup functions for Copy image from flash to SDRAM etc..It does not reinitialize the DDR though. Although i haven't dugged up the details yet, could someone tell me what is the difference between nand_boot.c and nand_load.S or the assembly code is just a helper for the nand_boot api's. I can't find any nand_load.S in my u-boot tree, and my tree is based on U-boot as of 2009-04-02 and the patches I sent yesterday. Which tree and what patches do you have? /Magnus ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Add imls utility command
Dear Marco, In message 49d8e8f3.4010...@gmail.com you wrote: + for (j = sectoroffset; j sectorcount; ++j) { i. e. add if (lseek(fd, j*sectorsize, SEEK_SET) != j*sectorsize) { error handling goes here } Mmm...I don't well understand why. For example if a sector is 128k and the header size is for example of 100 byte, after the read below, at the beginning of the cycle, the offset will be 100 byte (we say that sectoroffset is 0) and for example we don't find any image. At next cycle if I do an lseek of 1*128K, I'll get (1*128K)+100 byte as offset, at next (2*128k) + 200 byte and so on. To do this I should do an lseek after the read as lseek(fd,-readbyte,SEEK_CUR). Please think about this again. We use a single lseek() before each read() to position the read pointer at the next sector boundary, i.e. where we need it. We don't care whe reit is after the read(). ... + len = image_get_size(hdr); + data = malloc(len * sizeof(char)); Come on. sizeof(char) ? You must be joking. + if (!data) { + fprintf (stderr, %s: Can't allocate memory: %s\n, + cmdname, strerror(errno)); + exit(EXIT_FAILURE); + } Get rid of this malloc(), too. I can't know in this case the size of the data, to remove the malloc I have to allocate a fixed buffer of X byte, I think in this case a malloc is better. No. Who claims you must read the whole image at once? Use a fixed buffer of a convenient size (say PAGE_SIZE), and read the data sequentially. No need to allocate zillions of megabytes of memory at once. + lseek(fd, -len, SEEK_CUR); Why would this lseek() be needed? [And ifit ws needed, you should check it's return value.] It was needed to be aligned to sector boundary and set the file offset as before to call this function (see my comment above). Your thinking is inverted. Don't try to fix the read pointer after each read(). Set it as needed before the read() when necessary. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de A memorandum is written not to inform the reader, but to protect the writer. -- Dean Acheson ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC 3/5] Add NAND SPL entries to gitignore.
Hi 2009/4/3 Scott Wood scottw...@freescale.com: Magnus Lilja wrote: diff --git a/nand_spl/.gitignore b/nand_spl/.gitignore new file mode 100644 index 000..af5f02b --- /dev/null +++ b/nand_spl/.gitignore @@ -0,0 +1,7 @@ +# NAND-SPL files +/u-boot-spl +/u-boot-spl-aligned.bin +/u-boot-spl.bin +/u-boot-spl.map +/board/imx31_phycore/nand_boot_mx31.c +/board/imx31_phycore/*.S Hmm, can we create a directory for board-specific temporary files to go, so we don't need board-specific stuff in .gitignore? Or better, add some makefile rules so we can produce nand_spl versions of .o files without having to symlink the source anywhere. Sounds like a good idea. I have one solution for this now, I'll see if there's a better one before posting a suggestion tomorrow evening. /Magnus ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 V5] cmd_bdinfo: move implementation to arch instead of common
Dear Jean-Christophe PLAGNIOL-VILLARD, In message 1238927618-15438-1-git-send-email-plagn...@jcrosoft.com you wrote: introduce 3 new weak functions board_bdinfo, cpu_bdinfo and soc_bdinfo to allow board, cpu and soc to print more information Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Acked-by: Mike Frysinger vap...@gentoo.org Acked-by: Haavard Skinnemoen haavard.skinnem...@atmel.com ... diff --git a/include/bdinfo.h b/include/bdinfo.h new file mode 100644 index 000..cc44544 --- /dev/null +++ b/include/bdinfo.h @@ -0,0 +1,49 @@ +/* + * (C) Copyright 2008 + * Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com ... +static inline void print_num(const char *name, ulong value) +{ + printf (%-12s= 0x%08lX\n, name, value); +} + +static inline void print_lnum(const char *name, u64 value) +{ + printf (%-12s= 0x%.8llX\n, name, value); +} + +static inline void print_str(const char *name, const char *str) +{ + printf (%-12s= %6s MHz\n, name, str); +} + +void print_eth(int idx); You claim exclusive copyright for this code? I think this is not correct. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Question: How does one get fresh air into a Russian church? Answer: One clicks on an icon, and a window opens! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM Pull Request
Dear Jean-Christophe PLAGNIOL-VILLARD, In message 20090405105630.ga11...@game.jcrosoft.org you wrote: Hi Wolfgang, Please pull The following changes since commit 23e4af49e066a53cd3e3659b68ef90572d88de84: Guennadi Liakhovetski (1): ARM: add the imx31_phycore_eet target to MAINTAINERS are available in the git repository at: git://git.denx.de/u-boot-arm.git master Dirk Behme (1): OMAP3: Update Overo pin mux for new expansion board Jean-Christophe PLAGNIOL-VILLARD (4): arm: update co-processor 15 access arm: clean cache management arm: unify reset command integratorap: fix PCI support Kyungmin Park (1): Move machine specific code to board at s3c64xx (v2) Minkyu Kang (1): s3c64xx: fix the wrong gpio offset Sanjeev Premi (1): OMAP: Fix compile issue Tom Rix (2): OMAP3 Fix multiline formatting in board init files. ZOOM1 Remove legacy NAND defines board/armltd/integratorap/split_by_variant.sh | 18 +++- board/omap3/beagle/beagle.c | 20 ++-- board/omap3/evm/evm.c | 16 ++-- board/omap3/overo/overo.c | 12 +- board/omap3/overo/overo.h |9 +- board/omap3/pandora/pandora.c | 12 +- board/omap3/zoom1/zoom1.c | 12 +- board/samsung/smdk6400/lowlevel_init.S|7 ++ cpu/arm1136/cpu.c | 90 ++ cpu/arm1176/cpu.c | 103 + cpu/arm1176/s3c64xx/cpu_init.S|7 -- cpu/arm720t/cpu.c | 120 +++- cpu/arm920t/cpu.c | 124 ++-- cpu/arm925t/cpu.c | 96 ++- cpu/arm926ejs/cpu.c | 125 ++-- cpu/arm946es/cpu.c| 101 ++-- cpu/arm_cortexa8/cpu.c| 82 + cpu/arm_cortexa8/omap3/board.c|2 +- cpu/arm_intcm/cpu.c | 25 - cpu/ixp/cpu.c | 83 ++-- cpu/lh7a40x/cpu.c | 121 ++-- cpu/pxa/cpu.c | 81 ++-- cpu/s3c44b0/cpu.c |9 -- cpu/sa1100/cpu.c | 81 ++-- include/asm-arm/system.h | 84 + include/configs/B2.h |1 + include/configs/assabet.h |2 + include/configs/cerf250.h |3 + include/configs/cradle.h |3 + include/configs/csb226.h |4 + include/configs/delta.h |3 + include/configs/dnp1110.h |2 + include/configs/evb4510.h |1 + include/configs/gcplus.h |2 + include/configs/innokom.h |4 + include/configs/integratorap.h|4 +- include/configs/lart.h|2 + include/configs/logodl.h |4 + include/configs/lubbock.h |3 + include/configs/omap3_zoom1.h | 17 include/configs/pleb2.h |3 + include/configs/pxa255_idp.h |3 + include/configs/shannon.h |2 + include/configs/trizepsiv.h |3 + include/configs/wepep250.h|2 + include/configs/xaeniax.h |3 + include/configs/xm250.h |3 + include/configs/xsengine.h|3 + include/configs/zylonite.h|3 + include/s3c6400.h | 11 ++- lib_arm/Makefile |4 + lib_arm/cache-cp15.c | 120 lib_arm/reset.c | 53 +++ 53 files changed, 501 insertions(+), 1207 deletions(-) create mode 100644 include/asm-arm/system.h create mode 100644 lib_arm/cache-cp15.c create mode 100644 lib_arm/reset.c Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If at first you don't succeed, you are running about average. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 V5] cmd_bdinfo: move implementation to arch instead of common
On 23:01 Sun 05 Apr , Wolfgang Denk wrote: Dear Jean-Christophe PLAGNIOL-VILLARD, In message 1238927618-15438-1-git-send-email-plagn...@jcrosoft.com you wrote: introduce 3 new weak functions board_bdinfo, cpu_bdinfo and soc_bdinfo to allow board, cpu and soc to print more information Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Acked-by: Mike Frysinger vap...@gentoo.org Acked-by: Haavard Skinnemoen haavard.skinnem...@atmel.com ... diff --git a/include/bdinfo.h b/include/bdinfo.h new file mode 100644 index 000..cc44544 --- /dev/null +++ b/include/bdinfo.h @@ -0,0 +1,49 @@ +/* + * (C) Copyright 2008 + * Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com ... +static inline void print_num(const char *name, ulong value) +{ + printf (%-12s= 0x%08lX\n, name, value); +} + +static inline void print_lnum(const char *name, u64 value) +{ + printf (%-12s= 0x%.8llX\n, name, value); +} + +static inline void print_str(const char *name, const char *str) +{ + printf (%-12s= %6s MHz\n, name, str); +} + +void print_eth(int idx); You claim exclusive copyright for this code? I think this is not correct. I don't really care so please update as you wish Best Regards, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add support for Faraday RTC IP FTRTC
Hi Detlev Zundel, Thanks for your kindly help. I will fix my code and submit again next time. Thank you! regards, Po-Yu Chuang 2009/4/2 Detlev Zundel d...@denx.de: Hi Chuang, I am a newbie and I have not realized all the rules, so I have some questions. On Tue Mar 31 12:24:03 CEST 2009, you wrote: +static unsigned int rtc = CONFIG_SYS_RTC_BASE; Please use a proper C structure to describe the RTC; do not use base address plus offsets. Do you mean U-Boot prefers to use structure to describe registers? Yes, we prefer to have this, as we then also let the compiler do for example type checking. What if there were large gaps between registers? Use dummy variables. For example, in our ethernet IP FTMAC100, there is nothing in 0x34 - 0x84, 0xa0 - 0xc0. Should I use structure to describe it? Yes please, use for example u32 dummy1[20] for the first gap and u32 dummy2[8] for the second. I thought that placing a lot of paddings in a structure is ulgy. How do you think? Is there a guideline about this? We are our own guideline ;) No, seriously, we try to use structures wherever possible as a means to get more information to the compiler. It also helps preventing stupid errors like having one incorrect offset in a list of 40 defines which are *very* hard to catch. Also in drivers/rtc/pl031.c, the RTC_WRITE_REG and RTC_READ_REG use base + offset. outl() is not portable across architectures? inl() is not portable across architectures? Sorry I don't understand. There are outl() and inl() in most architectures except blackfin, i386 and sparc. And the outl() and the inl() I use are arm ones. Which macros should I use? We should really use macros specifying the expected-byteorder, i.e. in_be32, or out_le32, and so on. Using these macros, we can write drivers even being agnostic on the cpu byte ordering if the device stays the same. (Ok, ok, outl also infers a byte-ordering, but we like more expliciteness). + debug(rtc_get(): record register: %x\n, inl(rtc + FTRTC_OFFSET_RECORD)); Line too long. Sorry, this is my fault. I will fix them. Thanks! Detlev -- I just found out that the brain is like a computer. If that's true, then there really aren't any stupid people. Just people running Windows. -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot