Re: [U-Boot] Secure update of uboot devices?
Dear Andreas, please always keep the mailing list on Cc: In message cab+ekh69iuejcdkuyex2ndw_v5bdj6albblpun7ii7dnnaq...@mail.gmail.com you wrote: Actually what i think I am after is authentication of uboot that have somewhat been discussed before in http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg04707.html But I can't find if it has been done before I have no information that any such work has been done. 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 God wanted me to touch my toes, he'd have put them on my knees. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ppc4xx: Setup HICB on Io64
The FPGA High-Speed Interconnect Bus (HICB) is now setup by u-boot. Signed-off-by: Dirk Eibach eib...@gdsys.de --- board/gdsys/405ex/io64.c | 16 include/gdsys_fpga.h |5 - 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/board/gdsys/405ex/io64.c b/board/gdsys/405ex/io64.c index a997571..177141d 100644 --- a/board/gdsys/405ex/io64.c +++ b/board/gdsys/405ex/io64.c @@ -249,6 +249,7 @@ int last_stage_init(void) char str_serdes[] = Start SERDES blocks; char str_channels[] = Start FPGA channels; char str_locks[] = Verify SERDES locks; + char str_hicb[] = Verify HICB status; char str_status[] = Verify PHY status -; char slash[] = \\|/-\\|/-; @@ -312,6 +313,21 @@ int last_stage_init(void) } blank_string(strlen(str_locks)); + /* verify hicb_status */ + puts(str_hicb); + for (fpga = 0; fpga 2; ++fpga) { + u16 *ch0_hicb_status_int = (fpga ? fpga1 : fpga0)-ch0_hicb_status_int; + for (k = 0; k 32; ++k) { + u16 status = in_le16(ch0_hicb_status_int + 4*k); + if (status) + printf(fpga %d hicb %d: hicb status %04x\n, + fpga, k, status); + /* reset events */ + out_le16(ch0_hicb_status_int + 4*k, status); + } + } + blank_string(strlen(str_hicb)); + /* verify phy status */ puts(str_status); for (k = 0; k 32; ++k) { diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h index e7a072b..949864c 100644 --- a/include/gdsys_fpga.h +++ b/include/gdsys_fpga.h @@ -82,7 +82,10 @@ typedef struct ihs_fpga { u16 reserved_1[502];/* 0x0014 */ u16 ch0_status_int; /* 0x0400 */ u16 ch0_config_int; /* 0x0402 */ - u16 reserved_2[7677]; /* 0x0404 */ + u16 reserved_2[126];/* 0x0404 */ + u16 ch0_hicb_status_int;/* 0x0500 */ + u16 ch0_hicb_config_int;/* 0x0502 */ + u16 reserved_3[7549]; /* 0x0504 */ u16 reflection_high;/* 0x3ffe */ } ihs_fpga_t; #endif -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 3/4] mmc: fsl_esdhc: Implement card-detect hook.
This card-detect hook probably doesn't work. Perhaps somebody with more knowledge about the hardware can comment on this. I think that perhaps even the complete code from esdhc_init() could go into the getcd() function instead or mmc_getcd() needs to be called at some later time after mmc_init(), which, however, would require many other drivers to change. In addition to implementing the hook, this patch also removes the call to the board_mmc_getcd() function which is now called from the MMC framework and is no longer required here. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- drivers/mmc/fsl_esdhc.c | 29 - 1 files changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index f038acc..1ed5355 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -418,7 +418,6 @@ static int esdhc_init(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base; int timeout = 1000; - int ret = 0; /* Reset the entire host controller */ esdhc_write32(regs-sysctl, SYSCTL_RSTA); @@ -445,24 +444,19 @@ static int esdhc_init(struct mmc *mmc) /* Set timout to the maximum value */ esdhc_clrsetbits32(regs-sysctl, SYSCTL_TIMEOUT_MASK, 14 16); - /* Check if there is a callback for detecting the card */ - ret = board_mmc_getcd(mmc); - if (ret 0) { - timeout = 1000; - while (!(esdhc_read32(regs-prsstat) PRSSTAT_CINS) - --timeout) - udelay(1000); + return 0; +} - if (timeout = 0) - ret = NO_CARD_ERR; - } else { - if (ret == 0) - ret = NO_CARD_ERR; - else - ret = 0; - } +static int esdhc_getcd(struct mmc *mmc) +{ + struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base; + int timeout = 1000; + + while (!(esdhc_read32(regs-prsstat) PRSSTAT_CINS) --timeout) + udelay(1000); - return ret; + return timeout 0; } static void esdhc_reset(struct fsl_esdhc *regs) @@ -500,6 +494,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc-send_cmd = esdhc_send_cmd; mmc-set_ios = esdhc_set_ios; mmc-init = esdhc_init; + mmc-getcd = esdhc_getcd; voltage_caps = 0; caps = regs-hostcapblt; -- 1.7.8.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 0/4] mmc: Implement central card-detection.
This series of patches implements central card-detection within the MMC framework. Before this patch series, many boards actually did implement the board_mmc_getcd() function, but it wasn't used except by one driver (fsl_esdhc). Unfortunately, implementations interpreted the meaning of the cd parameter differently, some taking it to signal card absence and others using it to detect card presence. Furthermore, the signature of the board_mmc_getcd() function was not at all consistent with other MMC related functions. The first patch in this series therefore changes the board_mmc_getcd() function signature and consolidates all current implementations. The second patch adds a central card-detection implementation within the MMC framework by using the new board_mmc_getcd() function and adds a hook that can be provided by drivers to serve as a default card-detect mechanism if no board-specific implementation is provided. The third and fourth patches implement this driver hook for the fsl_esdhc and the tegra2 MMC drivers. For reference, the following email thread contains the discussion that led to this patch series: http://lists.denx.de/pipermail/u-boot/2011-November/110180.html Changes in v4: - rebase onto latest MMC tree as requested by Andy Fleming Changes in v3: - reword subject line of patch 1 to be less confusing - address coding style issues raised by Marek Vasut Changes in v2: - add a better rationale for the series and a reference to the email thread that started it - add an explanation to patch 3 why the call to board_mmc_getcd() is removed from the fsl_esdhc driver - add a cover letter which explains the series' goal Thierry Reding (4): mmc: Change board_mmc_getcd() function prototype. mmc: Implement card detection. mmc: fsl_esdhc: Implement card-detect hook. mmc: tegra2: Implement card-detect hook. board/efikamx/efikamx.c |9 + board/emk/top9000/top9000.c | 12 ++-- board/freescale/mx51evk/mx51evk.c |9 + board/freescale/mx53ard/mx53ard.c |9 + board/freescale/mx53evk/mx53evk.c |9 + board/freescale/mx53loco/mx53loco.c |9 + board/freescale/mx53smd/mx53smd.c |6 ++ doc/README.atmel_mci| 12 ++-- drivers/mmc/arm_pl180_mmci.c|1 + drivers/mmc/bfin_sdh.c |1 + drivers/mmc/davinci_mmc.c |1 + drivers/mmc/fsl_esdhc.c | 27 --- drivers/mmc/ftsdc010_esdhc.c|1 + drivers/mmc/gen_atmel_mci.c |1 + drivers/mmc/mmc.c | 22 -- drivers/mmc/mmc_spi.c |1 + drivers/mmc/mxcmmc.c|1 + drivers/mmc/mxsmmc.c|1 + drivers/mmc/omap_hsmmc.c|1 + drivers/mmc/pxa_mmc_gen.c |1 + drivers/mmc/s5p_mmc.c |1 + drivers/mmc/sdhci.c |1 + drivers/mmc/sh_mmcif.c |1 + drivers/mmc/tegra2_mmc.c| 32 +--- include/mmc.h |4 +++- 25 files changed, 92 insertions(+), 81 deletions(-) -- 1.7.8.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 4/4] mmc: tegra2: Implement card-detect hook.
On Tegra2, card-detection is implemented by passing the card-detection GPIOs to the MMC driver at initialization time. Instead of implementing the board_mmc_getcd() function, use the card-detect hook and allow boards to override it by providing their own board_mmc_getcd() implementation. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- drivers/mmc/tegra2_mmc.c | 32 +--- 1 files changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c index 035a868..5b4c9f6 100644 --- a/drivers/mmc/tegra2_mmc.c +++ b/drivers/mmc/tegra2_mmc.c @@ -474,6 +474,18 @@ static int mmc_core_init(struct mmc *mmc) return 0; } +int tegra2_mmc_getcd(struct mmc *mmc) +{ + struct mmc_host *host = (struct mmc_host *)mmc-priv; + + debug(tegra2_mmc_getcd called\n); + + if (host-cd_gpio = 0) + return !gpio_get_value(host-cd_gpio); + + return 1; +} + int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio) { struct mmc_host *host; @@ -512,6 +524,7 @@ int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio) mmc-send_cmd = mmc_send_cmd; mmc-set_ios = mmc_set_ios; mmc-init = mmc_core_init; + mmc-getcd = tegra2_mmc_getcd; mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; if (bus_width == 8) @@ -535,22 +548,3 @@ int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio) return 0; } - -/* this is a weak define that we are overriding */ -int board_mmc_getcd(u8 *cd, struct mmc *mmc) -{ - struct mmc_host *host = (struct mmc_host *)mmc-priv; - - debug(board_mmc_getcd called\n); - - *cd = 1; /* Assume card is inserted, or eMMC */ - - if (IS_SD(mmc)) { - if (host-cd_gpio = 0) { - if (gpio_get_value(host-cd_gpio)) - *cd = 0; - } - } - - return 0; -} -- 1.7.8.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 2/4] mmc: Implement card detection.
Check for card detect each time an MMC/SD device is initialized. If card detection is not implemented, this code behaves as before and continues assuming a card is present. If no card is detected, has_init is reset for the MMC/SD device (to force initialization next time) and an error is returned. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- drivers/mmc/arm_pl180_mmci.c |1 + drivers/mmc/bfin_sdh.c |1 + drivers/mmc/davinci_mmc.c|1 + drivers/mmc/ftsdc010_esdhc.c |1 + drivers/mmc/gen_atmel_mci.c |1 + drivers/mmc/mmc.c| 18 ++ drivers/mmc/mmc_spi.c|1 + drivers/mmc/mxcmmc.c |1 + drivers/mmc/mxsmmc.c |1 + drivers/mmc/omap_hsmmc.c |1 + drivers/mmc/pxa_mmc_gen.c|1 + drivers/mmc/s5p_mmc.c|1 + drivers/mmc/sdhci.c |1 + drivers/mmc/sh_mmcif.c |1 + include/mmc.h|2 ++ 15 files changed, 33 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index e6467a2..09d443e 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -385,6 +385,7 @@ static int arm_pl180_mmci_host_init(struct mmc *dev) dev-send_cmd = host_request; dev-set_ios = host_set_ios; dev-init = mmc_host_reset; + dev-getcd = NULL; dev-host_caps = 0; dev-voltages = VOLTAGE_WINDOW_MMC; dev-f_min = dev-clock; diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c index bc9057f..08fc5c1 100644 --- a/drivers/mmc/bfin_sdh.c +++ b/drivers/mmc/bfin_sdh.c @@ -250,6 +250,7 @@ int bfin_mmc_init(bd_t *bis) mmc-send_cmd = bfin_sdh_request; mmc-set_ios = bfin_sdh_set_ios; mmc-init = bfin_sdh_init; + mmc-getcd = NULL; mmc-host_caps = MMC_MODE_4BIT; mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34; diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index ce96736..ee8f261 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -387,6 +387,7 @@ int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host) mmc-send_cmd = dmmc_send_cmd; mmc-set_ios = dmmc_set_ios; mmc-init = dmmc_init; + mmc-getcd = NULL; mmc-f_min = 20; mmc-f_max = 2500; diff --git a/drivers/mmc/ftsdc010_esdhc.c b/drivers/mmc/ftsdc010_esdhc.c index 33cb5d6..f1702fe 100644 --- a/drivers/mmc/ftsdc010_esdhc.c +++ b/drivers/mmc/ftsdc010_esdhc.c @@ -665,6 +665,7 @@ int ftsdc010_mmc_init(int dev_index) mmc-send_cmd = ftsdc010_request; mmc-set_ios = ftsdc010_set_ios; mmc-init = ftsdc010_core_init; + mmc-getcd = NULL; mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34; diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index f346b24..4968c5e 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -337,6 +337,7 @@ int atmel_mci_init(void *regs) mmc-send_cmd = mci_send_cmd; mmc-set_ios = mci_set_ios; mmc-init = mci_init; + mmc-getcd = NULL; /* need to be able to pass these in on a board by board basis */ mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34; diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 11c6aa6..6db37b1 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -674,6 +674,18 @@ int mmc_switch_part(int dev_num, unsigned int part_num) | (part_num PART_ACCESS_MASK)); } +int mmc_getcd(struct mmc *mmc) +{ + int cd; + + cd = board_mmc_getcd(mmc); + + if ((cd 0) mmc-getcd) + cd = mmc-getcd(mmc); + + return cd; +} + int sd_switch(struct mmc *mmc, int mode, int group, u8 value, u8 *resp) { struct mmc_cmd cmd; @@ -1202,6 +1214,12 @@ int mmc_init(struct mmc *mmc) { int err; + if (mmc_getcd(mmc) == 0) { + mmc-has_init = 0; + printf(MMC: no card present\n); + return NO_CARD_ERR; + } + if (mmc-has_init) return 0; diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 49fb9e0..de43a85 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -272,6 +272,7 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode) mmc-send_cmd = mmc_spi_request; mmc-set_ios = mmc_spi_set_ios; mmc-init = mmc_spi_init_p; + mmc-getcd = NULL; mmc-host_caps = MMC_MODE_SPI; mmc-voltages = MMC_SPI_VOLTAGE; diff --git a/drivers/mmc/mxcmmc.c b/drivers/mmc/mxcmmc.c index ab1fc82..8afb221 100644 --- a/drivers/mmc/mxcmmc.c +++ b/drivers/mmc/mxcmmc.c @@ -500,6 +500,7 @@ static int mxcmci_initialize(bd_t *bis) mmc-send_cmd = mxcmci_request; mmc-set_ios = mxcmci_set_ios; mmc-init = mxcmci_init; + mmc-getcd = NULL; mmc-host_caps = MMC_MODE_4BIT; host-base = (struct
[U-Boot] [PATCH v4 1/4] mmc: Change board_mmc_getcd() function prototype.
The new API no longer uses the extra cd parameter that was used to store the card presence state. Instead, this information is returned via the function's return value. board_mmc_getcd() returns -1 to indicate that no card-detection mechanism is implemented; 0 indicates that no card is present and 1 is returned if it was detected that a card is present. The rationale for this change can be found in the following email thread: http://lists.denx.de/pipermail/u-boot/2011-November/110180.html In summary, the old API was not consistent with the rest of the MMC API which always passes a struct mmc as the first parameter. Furthermore the cd parameter was used to mean card absence in some implementations and card presence in others. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- board/efikamx/efikamx.c |9 + board/emk/top9000/top9000.c | 12 ++-- board/freescale/mx51evk/mx51evk.c |9 + board/freescale/mx53ard/mx53ard.c |9 + board/freescale/mx53evk/mx53evk.c |9 + board/freescale/mx53loco/mx53loco.c |9 + board/freescale/mx53smd/mx53smd.c |6 ++ doc/README.atmel_mci| 12 ++-- drivers/mmc/fsl_esdhc.c |8 +--- drivers/mmc/mmc.c |4 ++-- include/mmc.h |2 +- 11 files changed, 39 insertions(+), 50 deletions(-) diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c index 1f6c457..e88b2ed 100644 --- a/board/efikamx/efikamx.c +++ b/board/efikamx/efikamx.c @@ -314,17 +314,18 @@ static inline uint32_t efika_mmc_cd(void) return MX51_PIN_EIM_CS2; } -int board_mmc_getcd(u8 *absent, struct mmc *mmc) +int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; uint32_t cd = efika_mmc_cd(); + int ret; if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) - *absent = gpio_get_value(IOMUX_TO_GPIO(cd)); + ret = !gpio_get_value(IOMUX_TO_GPIO(cd)); else - *absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8)); + ret = !gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8)); - return 0; + return ret; } int board_mmc_init(bd_t *bis) diff --git a/board/emk/top9000/top9000.c b/board/emk/top9000/top9000.c index 6f5662a..e0b4cf2 100644 --- a/board/emk/top9000/top9000.c +++ b/board/emk/top9000/top9000.c @@ -108,17 +108,9 @@ int board_mmc_init(bd_t *bd) } /* this is a weak define that we are overriding */ -int board_mmc_getcd(u8 *cd, struct mmc *mmc) +int board_mmc_getcd(struct mmc *mmc) { - /* -* the only currently existing use of this function -* (fsl_esdhc.c) suggests this function must return -* *cs = TRUE if a card is NOT detected - in most -* cases the value of the pin when the detect switch -* closes to GND -*/ - *cd = at91_get_gpio_value(CONFIG_SYS_MMC_CD_PIN) ? 1 : 0; - return 0; + return !at91_get_gpio_value(CONFIG_SYS_MMC_CD_PIN); } #endif diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index e43aaf7..8d1f6a3 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -321,19 +321,20 @@ static void power_init(void) } #ifdef CONFIG_FSL_ESDHC -int board_mmc_getcd(u8 *cd, struct mmc *mmc) +int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + int ret; mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1); mxc_request_iomux(MX51_PIN_GPIO1_6, IOMUX_CONFIG_ALT0); if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) - *cd = gpio_get_value(0); + ret = !gpio_get_value(0); else - *cd = gpio_get_value(6); + ret = !gpio_get_value(6); - return 0; + return ret; } int board_mmc_init(bd_t *bis) diff --git a/board/freescale/mx53ard/mx53ard.c b/board/freescale/mx53ard/mx53ard.c index e5a1142..40b5c19 100644 --- a/board/freescale/mx53ard/mx53ard.c +++ b/board/freescale/mx53ard/mx53ard.c @@ -83,19 +83,20 @@ struct fsl_esdhc_cfg esdhc_cfg[2] = { {MMC_SDHC2_BASE_ADDR, 1 }, }; -int board_mmc_getcd(u8 *cd, struct mmc *mmc) +int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + int ret; mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1); mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1); if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) - *cd = gpio_get_value(1); /*GPIO1_1*/ + ret = !gpio_get_value(1); /* GPIO1_1 */ else - *cd = gpio_get_value(4); /*GPIO1_4*/ + ret = !gpio_get_value(4); /* GPIO1_4 */ - return 0; + return ret; } int board_mmc_init(bd_t *bis) diff --git
Re: [U-Boot] [PATCH v3 0/4] mmc: Implement central card-detection.
* Andy Fleming wrote: Could you rebase these patches on the top of the mmc tree? They don't apply cleanly anymore, and I don't want to mangle them in my attempts at hand-application. Hi Andy, I just sent out v4, which is rebased on the latest MMC tree (branch master). The conflict resolution was trivial (mx53smd now does some pinmuxing before reading the pin level). Btw, what's your take on Mike's comment: http://lists.denx.de/pipermail/u-boot/2011-December/114002.html I'm not sure how useful it would be to add this now. Tegra2 has an implementation that pretty much implements what Mike proposed, so I guess if anyone else wants to add such a generic implementation, Tegra2 could serve as reference (and could itself be refactored on top of that). Or would you rather prefer to add that change in this series as well? Thierry pgprlYpfaVxFn.pgp Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it
Hi Simon, In case you haven't noticed (I did not Cc you or Wolfgang, sorry 'bout that) I've posted the cleaned up version of my x86 init refactoring... On 02/01/12 10:48, Simon Glass wrote: Hi Graeme, On Sat, Dec 31, 2011 at 3:52 AM, Graeme Russ graeme.r...@gmail.com wrote: Hi Simon, On 31/12/11 13:02, Simon Glass wrote: Hi Graeme, On Fri, Dec 30, 2011 at 7:49 AM, Graeme Russ graeme.r...@gmail.com wrote: Hi Simon, [snip] Ah yes, looking a bit closer I see this now in patches 5 6. However, I think if you look at my patches 9, 10, 12 and 13 I'm doing essentially the same thing for x86. The difference is, I'm moving live code, rather than creating dead code then switching over. I personally do not think your approach is very safe - If there is a breakage, it is spread over multiple patches - With the 'move code around' approach, all breakages are confined to a single patch See my other email on this topic though - I feel that one test/fix cycle is better than testing every board for every little patch over an extended period. The problem is not one of how sparsely the test/fix cycles are spread over time, it is one of spreading the breakage over multiple patches - If you are replacing functionality then add the new functionality, add the hooks to use it and delete the old in a single patch. That way, if you change breaks something, the revert is trivial. If you multi-patch approach breaks something, the revert becomes more difficult. I don't think it is a huge job to do this for PowerPC also, and that seems to be the most feature-full architecture. I agree - The init architecture is the same, but the sequence is bigger (and not in the same order) Yes that's what I'm finding. Also it does depend on expectations. I would hope that moving an architecture over would be a fairly small task: - getting generic relocation working - adding functions for anything that is missing from board init code - removing things which don't work on the architecture? - worrying about differences in ordering between functions I see it as: 1) Rework the arch init sequence to be a pure list of 'int foo(void)' functions, adding helpers and wrappers where necessary 2) Switch over to use the generic init processing loop 3) Factor out common helpers and wrappers across all arches 4) Factor out common functionality (e.g. relocation) 5) After all arches are switched, remove wrappers by changing the function signature of the wrapped function 6) Move helpers into relevant driver/common source file I think 1 2 need to be done for at least ARM, x86 and PPC before starting 3 4 and 1-4 needs to be done for all arches before doing 5 6 OK yes we could do this. But I think the end result is different. I am keen to create a single common/board_f.c implementation for pre-reloc init and common/board_r.c for post-reloc init. I believe where your approach ends up with with separate arch/xxx/board.c files still, with their own initcall list, and a number of private Correct, but as a first step, the processing loop code is made common, leaving only the init arrays per-arch functions. Now this is better than where we are now, but my original complaint was that I want to be able to add features to a single place and have them work across all architectures. With your end-result I still need to figure out where to put the new feature in each initcall list and create 10 patches, one for each arch, to plumb it in. Agree, and my ultimate end goal (as per my previous initcall patch series) is to remove the per-arch init list as well... IMO the ordering differences between architectures are mostly unnecessary - an artifact of forking the code - and we should aim to minimise these differences. Putting everything in one file helps to clarify exactly what the differences are between archs, and discussions can take place as to why and whether this differences can be removed. If we accept that PPC is the one true way (in terms of U-Boot code base), then the job is to make other arch's code more like PPC. This is best done in one place I think. I see two issues with your approach: 1) You want to take a 'big bang' approach and change every arch over in one set of patches. I admire your vision, but question you realism ;) I took one look across all the init sequences and fled in horror. Such a big-bang approach is sure to cause some _major_ board breakage 2) As Wolfgang has eluded to, a unified set of init arrays will be more #ifdef than code After a bit of thought, I worry also that your approach will create an extended period of time where U-Boot is unstable, as patch are patch How so - Take a look at my x86 patch series. It only impacts x86 and it can be easily tested. Other arches are going to be even easier as the most delicate part of my series was getting global data to behave properly. For the other arches, it will be a simple
[U-Boot] initcall revisited - A new idea to discuss
Hi All, I've been thinking about the renaissance of the arch-independent initialisation sequence that has been generating a somewhat 'warm' discussion lately and had a thought based on a comment passed on by Wolfgang from Detlev: basicly what we are trying to solve is a dependency issue: each init function has a list of dependencies (other init steps) that need to be run before Which got me to thinking, what if we had an initcall macro which included the dependency information. Imagine this rough example: set_reloc_flag_r, init_bd_struct_r, mem_malloc_init_r, cpu_init_r, board_early_init_r, dram_init, interrupt_init, timer_init, display_banner, display_dram_config, 'display_banner' (for the sake of this example) needs 'dram_init' and 'board_early_init_r' while 'timer_init' needs 'interrupt_init' Now lets imagine a macro which we use thusly: int display_banner(void) { ... } INITCALL(display_banner, banner, dram,board_early) Which says that the display_banner() function, when completed fulfils the 'banner' dependency, and requires both the 'dram' and 'board_early' dependencies to be fulfilled in order to run We may also have... int serial_initialize_r(void) { ... } INITCALL(serial_initialize_r, serial,console, environment) int console_init_r(void) { ... } INITCALL(console_init_r, console, serial) So anything requiring 'console' must happen after both serial_initialize_r and console_init_r (yes, this is a trivial example, but it's the best I can come up with) So how do we implement it... If the INITCALL macro can place the parameter data in a separate section in the object file, and this data gets amalgamated into the libraries, we should be able to pull the information out during the build process. So the build process builds all the libraries, but before the final link, we autogenerate the 'init sequence' array using a fancy 'tool' which scans all the libraries and builds the init sequence in order to satisfy all the dependencies or throws an error if the dependencies cannot be met like: 'console_init_r' requires 'serial' but there are no 'serial' init functions or 'circular reference - 'serial' requires 'console' requires 'serial' etc. Thoughts? Regards, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Change kernel address in dataflash to match u-boot's size
On Mon, Jan 02, 2012 at 06:18:05AM +0100, Marek Vasut wrote : On at91sam platforms, u-boot grew larger than the allocated size in dataflash, the layout was: bootstrap 0x ubootenv 0x4200 uboot 0x8400 kernel 0x00042000 u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 = 0x39C00 bytes anymore. Loading the kernel from 0x44000 will make the process easier for users using the default configuration but they'll have to remember to flash the kernel at 0x44000. You're just pushing it slowly further. That's bogus: 1) ubootenv is at weird offset ... why such a weird number? Also, what about redund. env? It is atmel's defaults they seem to do some magic with the environment when flashing. I don't think this is necessary and don't have any issue changing that. 2) u-boot itself is at weird offset ... just set it to some normal location and let it be eg. up to 512kb big, to make sure you don't need to change it in the future. That makes sense, I though about it but I'm not so sure about the available space in dataflash on all the at91sam evaluation kits. 3) Why is env at offset 0x4200 ... is the bootstrap exactly so big ? what about erasing nor, you can't make sure you won't overwrite those 0x200 bytes safely too, right ? = I'd do the layout like this: 0x0 - bootstrap 0x05000 - u-boot (align to block size) 0x85000 - env (~16kb) 0x89000 - env redund note, here's some space, so align as necessary 0x9 - kernel It wastes a bit, but it's ready for future growth As said, I let the defaults from ATMEL as they were. I don't know if they had any specific reason to have the layout like that. Maybe they had issue with the available space on the dataflash. The bootstrap is around 4k. I'll try a new layout and come back with a proposal. I'll also check that it fits in most dataflash sizes. -- Alexandre Belloni ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] CONFIG_ENV_SIZE_REDUND
Hi all, Let me first start off to wish all of you a prosperous 2012. While browsing through the sources I noticed CONFIG_ENV_SIZE_REDUND and I am wondering if it carries any use at all. Why would the redundant env be any different in size than the original one? Seems odd to me. A quick grep through the sources revealed that most of the boards define it to be CONFIG_ENV_SIZE (sometimes with and sometimes without parenthesis around CONFIG_ENV_SIZE) 8 boards define it to be CONFIG_ENV_SECT_SIZE, but 7 of these also define CONFIG_ENV_SIZE to be equal to CONFIG_ENV_SECT_SIZE the weird one is quad100hd.h (whatever that may be) which says: #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE) but does not define CONFIG_ENV_SIZE. Fortunately the default seems to be CONFIG_ENV_SECT_SIZE. and 5 boards define CONFIG_ENV_SIZE_REDUND as a numerical value (e.g. 0x2000) but all identical to CONFIG_ENV_SIZE This is as far as the configs go In the sources there exist three places where things are referenced: tools/envcrc.c says: # if !defined(CONFIG_ENV_ADDR_REDUND) defined(CONFIG_ENV_OFFSET_REDUND) # define CONFIG_ENV_ADDR_REDUND(CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND) # endif common/env_flash.c says: #if defined(CONFIG_ENV_SIZE_REDUND) \ (CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE) #error CONFIG_ENV_SIZE_REDUND should not be less then CONFIG_ENV_SIZE #endif and common/env_nand.c says: #if defined(CONFIG_ENV_SIZE_REDUND) \ (CONFIG_ENV_SIZE_REDUND != CONFIG_ENV_SIZE) #error CONFIG_ENV_SIZE_REDUND should be the same as CONFIG_ENV_SIZE #endif and finally there is ./include/environment.h which says # if defined(CONFIG_ENV_ADDR_REDUND) !defined(CONFIG_ENV_SIZE_REDUND) # define CONFIG_ENV_SIZE_REDUNDCONFIG_ENV_SIZE # endif I could not find any place where the value is actually used! Is it meaningful to keep this around? Shouldn't we just remove it ? Best regards, Frans. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fw_env.h: added a few missing defines
The README file lists 4 defined that were not actually present in the .h file but that were needed to get things working with settings compiled in. They are Added these to the .h file (the values above are the ones from the README file) Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com --- Noticed this was not applied and still pending in my git tree Couldn't find a trace that I actually posted it so here it is (possibly again) tools/env/fw_env.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 9258c79..2dcb373 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -34,8 +34,12 @@ #define DEVICE2_NAME /dev/mtd2 #define DEVICE1_OFFSET0x #define ENV1_SIZE 0x4000 +#define DEVICE1_ESIZE 0x4000 +#define DEVICE1_ENVSECTORS 2 #define DEVICE2_OFFSET0x #define ENV2_SIZE 0x4000 +#define DEVICE2_ESIZE 0x4000 +#define DEVICE2_ENVSECTORS 2 #define CONFIG_BAUDRATE115200 #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] tools/env/fw_env.h comment/code mismatch
tools/env/fw_env.h states: /* * To build the utility with the run-time configuration * uncomment the next line. * See included fw_env.config sample file * for notes on configuration. */ #define CONFIG_FILE /etc/fw_env.config However the define is already uncommented. I see two possible fixes: 1: add a // before the #define to make the code in accordance with the comment 2: reprase the comment so it is in accordance with the code Whatever is preferred? Frans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fw_env: use vars from the board config
it is quite odd that fw_printenv/fw_setenv does not use the settings from include/configs but instead redefines things. This patch uses the variables from the config file The edit in fw_env.c is only needed to resolve a name clash Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com --- Note: this is more intended to get some feedback. (also to see if I am on the right track) I did test the changes locally. (and yes, I know there are some more things that could be cleaned up). --- tools/env/fw_env.c | 20 ++-- tools/env/fw_env.h | 36 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 996682e..6597fbf 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -79,7 +79,7 @@ static int dev_current; #define ENVSECTORS(i) envdevices[(i)].env_sectors #define DEVTYPE(i)envdevices[(i)].mtd_type -#define CONFIG_ENV_SIZE ENVSIZE(dev_current) +#define CFG_ENV_SIZE ENVSIZE(dev_current) #define ENV_SIZE getenvsize() @@ -216,7 +216,7 @@ static int get_config (char *); #endif static inline ulong getenvsize (void) { - ulong rc = CONFIG_ENV_SIZE - sizeof (long); + ulong rc = CFG_ENV_SIZE - sizeof (long); if (HaveRedundEnv) rc -= sizeof (char); @@ -425,7 +425,7 @@ int fw_env_write(char *name, char *value) ++env; /* * Overflow when: -* name + = + val +\0\0 CONFIG_ENV_SIZE - (env-environment) +* name + = + val +\0\0 CFG_ENV_SIZE - (env-environment) */ len = strlen (name) + 2; /* add '=' for first arg, ' ' for all others */ @@ -941,7 +941,7 @@ static int flash_write (int fd_current, int fd_target, int dev_target) DEVOFFSET (dev_target), DEVNAME (dev_target)); #endif rc = flash_write_buf (dev_target, fd_target, environment.image, - CONFIG_ENV_SIZE, DEVOFFSET (dev_target), + CFG_ENV_SIZE, DEVOFFSET (dev_target), DEVTYPE(dev_target)); if (rc 0) return rc; @@ -980,10 +980,10 @@ static int flash_read (int fd) DEVTYPE(dev_current) = mtdinfo.type; - rc = flash_read_buf (dev_current, fd, environment.image, CONFIG_ENV_SIZE, + rc = flash_read_buf (dev_current, fd, environment.image, CFG_ENV_SIZE, DEVOFFSET (dev_current), mtdinfo.type); - return (rc != CONFIG_ENV_SIZE) ? -1 : 0; + return (rc != CFG_ENV_SIZE) ? -1 : 0; } static int flash_io (int mode) @@ -1080,11 +1080,11 @@ int fw_env_open(void) if (parse_config ())/* should fill envdevices */ return -1; - addr0 = calloc (1, CONFIG_ENV_SIZE); + addr0 = calloc (1, CFG_ENV_SIZE); if (addr0 == NULL) { fprintf (stderr, Not enough memory for environment (%ld bytes)\n, - CONFIG_ENV_SIZE); + CFG_ENV_SIZE); return -1; } @@ -1119,11 +1119,11 @@ int fw_env_open(void) flag0 = *environment.flags; dev_current = 1; - addr1 = calloc (1, CONFIG_ENV_SIZE); + addr1 = calloc (1, CFG_ENV_SIZE); if (addr1 == NULL) { fprintf (stderr, Not enough memory for environment (%ld bytes)\n, - CONFIG_ENV_SIZE); + CFG_ENV_SIZE); return -1; } redundant = addr1; diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 2dcb373..8fcc5bd 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -24,30 +24,26 @@ /* * To build the utility with the run-time configuration * uncomment the next line. - * See included fw_env.config sample file + * See included fw_env.config sample file (TRAB board) * for notes on configuration. */ -#define CONFIG_FILE /etc/fw_env.config +//#define CONFIG_FILE /etc/fw_env.config -#define HAVE_REDUND /* For systems with 2 env sectors */ -#define DEVICE1_NAME /dev/mtd1 -#define DEVICE2_NAME /dev/mtd2 -#define DEVICE1_OFFSET0x -#define ENV1_SIZE 0x4000 -#define DEVICE1_ESIZE 0x4000 -#define DEVICE1_ENVSECTORS 2 -#define DEVICE2_OFFSET0x -#define ENV2_SIZE 0x4000 -#define DEVICE2_ESIZE 0x4000 -#define DEVICE2_ENVSECTORS 2 +#include config.h -#define CONFIG_BAUDRATE115200 -#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ -#define CONFIG_BOOTCOMMAND \ - bootp; \ - setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} \ -
[U-Boot] [PATCH 0/6] Cleanups and updates for cm-t35/3730
This patch series some what clean up cm-t35 board files, add separate EEPROM handling file, fixes the incorrect board revision passed to Linux. Nikita Kiryanov (6): cm-t35: cleanup the config file cm-t35: various cleanups cm-t35: add EEPROM module and pass Linux a serial number omap3: make get_board_rev() function weak cm-t35: pass correct revision information to Linux cm-t35: use the new EEPROM module to read the MAC address arch/arm/cpu/armv7/omap3/sys_info.c |3 +- board/cm_t35/Makefile |4 +- board/cm_t35/cm_t35.c | 16 ++--- board/cm_t35/eeprom.c | 125 +++ board/cm_t35/eeprom.h | 45 + include/configs/cm_t35.h| 80 +++--- 6 files changed, 223 insertions(+), 50 deletions(-) create mode 100644 board/cm_t35/eeprom.c create mode 100644 board/cm_t35/eeprom.h -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/6] cm-t35: cleanup the config file
From: Nikita Kiryanov nik...@compulab.co.il Remove values from boolean defines, fix indentation, etc.. No functional changes. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- include/configs/cm_t35.h | 78 +++--- 1 files changed, 39 insertions(+), 39 deletions(-) diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h index 0385ee8..61226d5 100644 --- a/include/configs/cm_t35.h +++ b/include/configs/cm_t35.h @@ -1,6 +1,5 @@ /* - * (C) Copyright 2011 - * CompuLab, Ltd. + * (C) Copyright 2011 CompuLab, Ltd. * Mike Rapoport m...@compulab.co.il * Igor Grinberg grinb...@compulab.co.il * @@ -36,9 +35,9 @@ /* * High Level Configuration Options */ -#define CONFIG_OMAP1 /* in a TI OMAP core */ -#define CONFIG_OMAP34XX1 /* which is a 34XX */ -#define CONFIG_CM_T3X 1 /* working with CM-T35 and CM-T3730 */ +#define CONFIG_OMAP/* in a TI OMAP core */ +#define CONFIG_OMAP34XX/* which is a 34XX */ +#define CONFIG_CM_T3X /* working with CM-T35 and CM-T3730 */ #define CONFIG_SYS_TEXT_BASE 0x80008000 @@ -50,8 +49,8 @@ /* * Display CPU and Board information */ -#define CONFIG_DISPLAY_CPUINFO 1 -#define CONFIG_DISPLAY_BOARDINFO 1 +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO /* Clock Defines */ #define V_OSCK 2600/* Clock output from T2 */ @@ -69,17 +68,17 @@ */ #define CONFIG_SYS_BOOTMAPSZ 0x4000 -#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ -#define CONFIG_SETUP_MEMORY_TAGS 1 -#define CONFIG_INITRD_TAG 1 -#define CONFIG_REVISION_TAG1 +#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ +#define CONFIG_SETUP_MEMORY_TAGS +#define CONFIG_INITRD_TAG +#define CONFIG_REVISION_TAG /* * Size of malloc() pool */ -#define CONFIG_ENV_SIZE(128 10) /* 128 KiB */ - /* Sector */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 10)) +#define CONFIG_ENV_SIZE(128 10) /* 128 KiB */ + /* Sector */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 10)) /* * Hardware drivers @@ -107,20 +106,21 @@ #define CONFIG_BAUDRATE115200 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ 115200} -#define CONFIG_GENERIC_MMC 1 -#define CONFIG_MMC 1 -#define CONFIG_OMAP_HSMMC 1 -#define CONFIG_DOS_PARTITION 1 + +#define CONFIG_GENERIC_MMC +#define CONFIG_MMC +#define CONFIG_OMAP_HSMMC +#define CONFIG_DOS_PARTITION /* USB */ -#define CONFIG_MUSB_UDC1 -#define CONFIG_USB_OMAP3 1 -#define CONFIG_TWL4030_USB 1 +#define CONFIG_MUSB_UDC +#define CONFIG_USB_OMAP3 +#define CONFIG_TWL4030_USB /* USB device configuration */ -#define CONFIG_USB_DEVICE 1 -#define CONFIG_USB_TTY 1 -#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +#define CONFIG_USB_DEVICE +#define CONFIG_USB_TTY +#define CONFIG_SYS_CONSOLE_IS_IN_ENV /* commands to include */ #include config_cmd_default.h @@ -131,10 +131,10 @@ #define CONFIG_CMD_JFFS2 /* JFFS2 Support*/ #define CONFIG_CMD_MTDPARTS/* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -#define MTDIDS_DEFAULT nand0=nand -#define MTDPARTS_DEFAULT mtdparts=nand:512k(x-loader),\ - 1920k(u-boot),128k(u-boot-env),\ - 4m(kernel),-(fs) +#define MTDIDS_DEFAULT nand0=nand +#define MTDPARTS_DEFAULT mtdparts=nand:512k(x-loader),\ + 1920k(u-boot),128k(u-boot-env),\ + 4m(kernel),-(fs) #define CONFIG_CMD_I2C /* I2C serial bus support */ #define CONFIG_CMD_MMC /* MMC support */ @@ -147,30 +147,30 @@ #undef CONFIG_CMD_IMLS /* List all found images*/ #define CONFIG_SYS_NO_FLASH -#define CONFIG_HARD_I2C1 +#define CONFIG_HARD_I2C #define CONFIG_SYS_I2C_SPEED 10 #define CONFIG_SYS_I2C_SLAVE 1 #define CONFIG_SYS_I2C_BUS 0 #define CONFIG_SYS_I2C_BUS_SELECT 1 -#define CONFIG_DRIVER_OMAP34XX_I2C 1 +#define CONFIG_DRIVER_OMAP34XX_I2C /* * TWL4030 */ -#define CONFIG_TWL4030_POWER 1 -#define CONFIG_TWL4030_LED 1 +#define CONFIG_TWL4030_POWER +#define CONFIG_TWL4030_LED /* * Board NAND Info. */ -#define CONFIG_SYS_NAND_QUIET_TEST 1 +#define CONFIG_SYS_NAND_QUIET_TEST #define CONFIG_NAND_OMAP_GPMC
[U-Boot] [PATCH 2/6] cm-t35: various cleanups
From: Nikita Kiryanov nik...@compulab.co.il Move #ifdef CONFIG_SMC911X out of board_eth_init() function, simplify the board_mmc_init() function, and enclose handle_mac_address() in the CONFIG_SMC911X. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- board/cm_t35/cm_t35.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c index 420cd70..ff372d8 100644 --- a/board/cm_t35/cm_t35.c +++ b/board/cm_t35/cm_t35.c @@ -1,6 +1,5 @@ /* - * (C) Copyright 2011 - * CompuLab, Ltd. www.compulab.co.il + * (C) Copyright 2011 CompuLab, Ltd. www.compulab.co.il * * Authors: Mike Rapoport m...@compulab.co.il * Igor Grinberg grinb...@compulab.co.il @@ -316,8 +315,7 @@ void set_muxconf_regs(void) #ifdef CONFIG_GENERIC_MMC int board_mmc_init(bd_t *bis) { - omap_mmc_init(0); - return 0; + return omap_mmc_init(0); } #endif @@ -370,6 +368,7 @@ static void reset_net_chip(void) static inline void reset_net_chip(void) {} #endif +#ifdef CONFIG_SMC911X /* * Routine: handle_mac_address * Description: prepare MAC address for on-board Ethernet. @@ -404,7 +403,6 @@ int board_eth_init(bd_t *bis) { int rc = 0, rc1 = 0; -#ifdef CONFIG_SMC911X setup_net_chip_gmpc(); reset_net_chip(); @@ -419,7 +417,7 @@ int board_eth_init(bd_t *bis) rc1 = smc911x_initialize(1, SB_T35_SMC911X_BASE); if (rc1 0) rc++; -#endif return rc; } +#endif -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/6] cm-t35: add EEPROM module and pass Linux a serial number
From: Nikita Kiryanov nik...@compulab.co.il Add board specific EEPROM handling module, read the serial number from the EEPROM and pass it to Linux. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- board/cm_t35/Makefile|4 ++- board/cm_t35/eeprom.c| 79 ++ board/cm_t35/eeprom.h| 38 ++ include/configs/cm_t35.h |2 + 4 files changed, 122 insertions(+), 1 deletions(-) create mode 100644 board/cm_t35/eeprom.c create mode 100644 board/cm_t35/eeprom.h diff --git a/board/cm_t35/Makefile b/board/cm_t35/Makefile index 27693f0..894fa09 100644 --- a/board/cm_t35/Makefile +++ b/board/cm_t35/Makefile @@ -25,7 +25,9 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).o -COBJS := cm_t35.o leds.o +COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += eeprom.o + +COBJS := cm_t35.o leds.o $(COBJS-y) SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/cm_t35/eeprom.c b/board/cm_t35/eeprom.c new file mode 100644 index 000..3bd7751 --- /dev/null +++ b/board/cm_t35/eeprom.c @@ -0,0 +1,79 @@ +/* + * (C) Copyright 2011 CompuLab, Ltd. www.compulab.co.il + * + * Authors: Nikita Kiryanov nik...@compulab.co.il + * Igor Grinberg grinb...@compulab.co.il + * + * 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. + */ + +#include common.h +#include i2c.h + +#define EEPROM_ADDR0x50 + +#define EEPROM_LAYOUT_VER_OFFSET 44 +#define BOARD_SERIAL_OFFSET20 +#define BOARD_SERIAL_OFFSET_LEGACY 8 + +#define LAYOUT_INVALID 0 +#define LAYOUT_LEGACY 0xff + +static uchar eeprom_layout; /* Implicitly LAYOUT_INVALID */ + +static int cm_t3x_eeprom_read(uint offset, uchar *buf, int len) +{ + return i2c_read(EEPROM_ADDR, offset, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, + buf, len); +} + +static int eeprom_setup_layout(void) +{ + int res; + + if (eeprom_layout != LAYOUT_INVALID) + return 0; + + res = cm_t3x_eeprom_read(EEPROM_LAYOUT_VER_OFFSET, eeprom_layout, 1); + if (res) { + eeprom_layout = LAYOUT_INVALID; + return res; + } + + if (eeprom_layout == 0 || eeprom_layout = 0x20) + eeprom_layout = LAYOUT_LEGACY; + + return 0; +} + +void get_board_serial(struct tag_serialnr *serialnr) +{ + u32 serial[2]; + uint offset; + + memset(serialnr, 0, sizeof(*serialnr)); + if (eeprom_setup_layout()) + return; + + offset = (eeprom_layout != LAYOUT_LEGACY) ? + BOARD_SERIAL_OFFSET : BOARD_SERIAL_OFFSET_LEGACY; + if (cm_t3x_eeprom_read(offset, (uchar *)serial, 8)) + return; + + if (serial[0] != 0x serial[1] != 0x) { + serialnr-low = serial[0]; + serialnr-high = serial[1]; + } +} diff --git a/board/cm_t35/eeprom.h b/board/cm_t35/eeprom.h new file mode 100644 index 000..97a002a --- /dev/null +++ b/board/cm_t35/eeprom.h @@ -0,0 +1,38 @@ +/* + * (C) Copyright 2011 CompuLab, Ltd. www.compulab.co.il + * + * Authors: Nikita Kiryanov nik...@compulab.co.il + * Igor Grinberg grinb...@compulab.co.il + * + * 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. + */ +#ifndef _EEPROM_ +#define _EEPROM_ + +#include common.h + +#ifndef CONFIG_DRIVER_OMAP34XX_I2C +void get_board_serial(struct tag_serialnr *serialnr) +{ + /* +* This corresponds to what happens when we can communicate with the +* eeprom but don't get a valid board serial value. +*/ + serialnr-low = 0; + serialnr-high = 0; +}; +#endif /*
[U-Boot] [PATCH 4/6] omap3: make get_board_rev() function weak
From: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- arch/arm/cpu/armv7/omap3/sys_info.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/omap3/sys_info.c b/arch/arm/cpu/armv7/omap3/sys_info.c index 22887ae..cde4093 100644 --- a/arch/arm/cpu/armv7/omap3/sys_info.c +++ b/arch/arm/cpu/armv7/omap3/sys_info.c @@ -197,10 +197,11 @@ u32 get_gpmc0_width(void) * get_board_rev() - setup to pass kernel board revision information * returns:(bit[0-3] sub version, higher bit[7-4] is higher version) */ -u32 get_board_rev(void) +u32 __get_board_rev(void) { return 0x20; } +u32 get_board_rev(void) __attribute__((weak, alias(__get_board_rev))); / * get_base(); get upper addr of current execution -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/6] cm-t35: pass correct revision information to Linux
From: Nikita Kiryanov nik...@compulab.co.il Read revision from EEPROM and pass it to Linux. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- board/cm_t35/eeprom.c | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/board/cm_t35/eeprom.c b/board/cm_t35/eeprom.c index 3bd7751..8386d18 100644 --- a/board/cm_t35/eeprom.c +++ b/board/cm_t35/eeprom.c @@ -27,6 +27,10 @@ #define EEPROM_LAYOUT_VER_OFFSET 44 #define BOARD_SERIAL_OFFSET20 #define BOARD_SERIAL_OFFSET_LEGACY 8 +#define BOARD_REV_OFFSET 0 +#define BOARD_REV_OFFSET_LEGACY6 +#define BOARD_REV_SIZE 4 +#define BOARD_REV_SIZE_LEGACY 2 #define LAYOUT_INVALID 0 #define LAYOUT_LEGACY 0xff @@ -77,3 +81,27 @@ void get_board_serial(struct tag_serialnr *serialnr) serialnr-high = serial[1]; } } + +/* + * Routine: get_board_rev + * Description: read system revision + */ +u32 get_board_rev(void) +{ + u32 rev = 0; + uint offset = BOARD_REV_OFFSET_LEGACY; + int len = BOARD_REV_SIZE_LEGACY; + + if (eeprom_setup_layout()) + return 0; + + if (eeprom_layout != LAYOUT_LEGACY) { + offset = BOARD_REV_OFFSET; + len = BOARD_REV_SIZE; + } + + if (cm_t3x_eeprom_read(offset, (uchar *)rev, len)) + return 0; + + return rev; +}; -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/6] cm-t35: use the new EEPROM module to read the MAC address
From: Nikita Kiryanov nik...@compulab.co.il Switch to the new EEPROM module and fix the problem of MAC address being read from the wrong offset due to lack of distinction between EEPROM layouts. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- board/cm_t35/cm_t35.c |6 +++--- board/cm_t35/eeprom.c | 18 ++ board/cm_t35/eeprom.h |9 - 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c index ff372d8..caafe06 100644 --- a/board/cm_t35/cm_t35.c +++ b/board/cm_t35/cm_t35.c @@ -41,6 +41,8 @@ #include asm/arch/sys_proto.h #include asm/mach-types.h +#include eeprom.h + DECLARE_GLOBAL_DATA_PTR; const omap3_sysinfo sysinfo = { @@ -382,11 +384,9 @@ static int handle_mac_address(void) if (rc) return 0; -#ifdef CONFIG_DRIVER_OMAP34XX_I2C - rc = i2c_read(0x50, 0, 1, enetaddr, 6); + rc = cm_t3x_eeprom_read_mac_addr(enetaddr); if (rc) return rc; -#endif if (!is_valid_ether_addr(enetaddr)) return -1; diff --git a/board/cm_t35/eeprom.c b/board/cm_t35/eeprom.c index 8386d18..e975855 100644 --- a/board/cm_t35/eeprom.c +++ b/board/cm_t35/eeprom.c @@ -31,6 +31,8 @@ #define BOARD_REV_OFFSET_LEGACY6 #define BOARD_REV_SIZE 4 #define BOARD_REV_SIZE_LEGACY 2 +#define MAC_ADDR_OFFSET4 +#define MAC_ADDR_OFFSET_LEGACY 0 #define LAYOUT_INVALID 0 #define LAYOUT_LEGACY 0xff @@ -83,6 +85,22 @@ void get_board_serial(struct tag_serialnr *serialnr) } /* + * Routine: cm_t3x_eeprom_read_mac_addr + * Description: read mac address and store it in buf. + */ +int cm_t3x_eeprom_read_mac_addr(uchar *buf) +{ + uint offset; + + if (eeprom_setup_layout()) + return 0; + + offset = (eeprom_layout != LAYOUT_LEGACY) ? + MAC_ADDR_OFFSET : MAC_ADDR_OFFSET_LEGACY; + return cm_t3x_eeprom_read(offset, buf, 6); +} + +/* * Routine: get_board_rev * Description: read system revision */ diff --git a/board/cm_t35/eeprom.h b/board/cm_t35/eeprom.h index 97a002a..e8680d7 100644 --- a/board/cm_t35/eeprom.h +++ b/board/cm_t35/eeprom.h @@ -23,7 +23,9 @@ #include common.h -#ifndef CONFIG_DRIVER_OMAP34XX_I2C +#ifdef CONFIG_DRIVER_OMAP34XX_I2C +int cm_t3x_eeprom_read_mac_addr(uchar *buf); +#else void get_board_serial(struct tag_serialnr *serialnr) { /* @@ -33,6 +35,11 @@ void get_board_serial(struct tag_serialnr *serialnr) serialnr-low = 0; serialnr-high = 0; }; + +int cm_t3x_eeprom_read_mac_addr(uchar *buf) +{ + return 1; +} #endif /* CONFIG_DRIVER_OMAP34XX_I2C */ #endif -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it
Dear Graeme Russ, In message 4f019473.8000...@gmail.com you wrote: The problem is not one of how sparsely the test/fix cycles are spread over time, it is one of spreading the breakage over multiple patches - If you are replacing functionality then add the new functionality, add the hooks to use it and delete the old in a single patch. That way, if you change breaks something, the revert is trivial. If you multi-patch approach breaks something, the revert becomes more difficult. True. Especially as it's likely that different patches will break different boards, so there will not even be a chance so revert. Well I don't propose to create things which are not bisect-able. I But you have - You create new functionality in one patch, add a number of patches, then finally use that new functionality in a later patch. This is what I fear as well. 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 Disc space - the final frontier! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] initcall revisited - A new idea to discuss
Dear Graeme Russ, In message 4f019abb.9010...@gmail.com you wrote: Which got me to thinking, what if we had an initcall macro which included the dependency information. Imagine this rough example: ... INITCALL(display_banner, banner, dram,board_early) Which says that the display_banner() function, when completed fulfils the 'banner' dependency, and requires both the 'dram' and 'board_early' dependencies to be fulfilled in order to run Sounds great! 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 Our OS who art in CPU, UNIX be thy name. Thy programs run, thy syscalls done, In kernel as it is in user! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] stuck after redirecting stdout to nc
Hello, On uboot loading, I checking a specific environement (called consoleddev), to decide to rediect console to nc or staying in serial. I then see some strange behaviour: if the environment tell uboot to redirect to net console, everything works well, but only if the ethernet cable is connected. if it is not connected then I see that the kernel is not loading. *relevant environemets: ncip 192.168.3.10 ipaddr 192.168.3.33 I would appreciate your advice, Regards, Ran -- View this message in context: http://old.nabble.com/stuck-after-redirecting-stdout-to-nc-tp33066296p33066296.html Sent from the Uboot - Users mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] fw_env: use vars from the board config
it is quite odd that fw_printenv/fw_setenv does not use the settings from include/configs but instead redefines things. This patch uses the variables from the config file The edit in fw_env.c is only needed to resolve a name clash Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com --- Note: this is more intended to get some feedback. (also to see if I am on the right track) I did test the changes locally. (and yes, I know there are some more things that could be cleaned up). --- tools/env/fw_env.c | 20 ++-- tools/env/fw_env.h | 36 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 996682e..6597fbf 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -79,7 +79,7 @@ static int dev_current; #define ENVSECTORS(i) envdevices[(i)].env_sectors #define DEVTYPE(i)envdevices[(i)].mtd_type -#define CONFIG_ENV_SIZE ENVSIZE(dev_current) +#define CFG_ENV_SIZE ENVSIZE(dev_current) NAK, don't change it to CFG_... for no reason! Why did you change it ? Just use ENVSIZE(dev_current) instead. M #define ENV_SIZE getenvsize() @@ -216,7 +216,7 @@ static int get_config (char *); #endif static inline ulong getenvsize (void) { - ulong rc = CONFIG_ENV_SIZE - sizeof (long); + ulong rc = CFG_ENV_SIZE - sizeof (long); if (HaveRedundEnv) rc -= sizeof (char); @@ -425,7 +425,7 @@ int fw_env_write(char *name, char *value) ++env; /* * Overflow when: - * name + = + val +\0\0 CONFIG_ENV_SIZE - (env-environment) + * name + = + val +\0\0 CFG_ENV_SIZE - (env-environment) */ len = strlen (name) + 2; /* add '=' for first arg, ' ' for all others */ @@ -941,7 +941,7 @@ static int flash_write (int fd_current, int fd_target, int dev_target) DEVOFFSET (dev_target), DEVNAME (dev_target)); #endif rc = flash_write_buf (dev_target, fd_target, environment.image, - CONFIG_ENV_SIZE, DEVOFFSET (dev_target), + CFG_ENV_SIZE, DEVOFFSET (dev_target), DEVTYPE(dev_target)); if (rc 0) return rc; @@ -980,10 +980,10 @@ static int flash_read (int fd) DEVTYPE(dev_current) = mtdinfo.type; - rc = flash_read_buf (dev_current, fd, environment.image, CONFIG_ENV_SIZE, + rc = flash_read_buf (dev_current, fd, environment.image, CFG_ENV_SIZE, DEVOFFSET (dev_current), mtdinfo.type); - return (rc != CONFIG_ENV_SIZE) ? -1 : 0; + return (rc != CFG_ENV_SIZE) ? -1 : 0; } static int flash_io (int mode) @@ -1080,11 +1080,11 @@ int fw_env_open(void) if (parse_config ())/* should fill envdevices */ return -1; - addr0 = calloc (1, CONFIG_ENV_SIZE); + addr0 = calloc (1, CFG_ENV_SIZE); if (addr0 == NULL) { fprintf (stderr, Not enough memory for environment (%ld bytes)\n, - CONFIG_ENV_SIZE); + CFG_ENV_SIZE); return -1; } @@ -1119,11 +1119,11 @@ int fw_env_open(void) flag0 = *environment.flags; dev_current = 1; - addr1 = calloc (1, CONFIG_ENV_SIZE); + addr1 = calloc (1, CFG_ENV_SIZE); if (addr1 == NULL) { fprintf (stderr, Not enough memory for environment (%ld bytes)\n, - CONFIG_ENV_SIZE); + CFG_ENV_SIZE); return -1; } redundant = addr1; diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 2dcb373..8fcc5bd 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -24,30 +24,26 @@ /* * To build the utility with the run-time configuration * uncomment the next line. - * See included fw_env.config sample file + * See included fw_env.config sample file (TRAB board) * for notes on configuration. */ -#define CONFIG_FILE /etc/fw_env.config +//#define CONFIG_FILE /etc/fw_env.config -#define HAVE_REDUND /* For systems with 2 env sectors */ -#define DEVICE1_NAME /dev/mtd1 -#define DEVICE2_NAME /dev/mtd2 -#define DEVICE1_OFFSET0x -#define ENV1_SIZE 0x4000 -#define DEVICE1_ESIZE 0x4000 -#define DEVICE1_ENVSECTORS 2 -#define DEVICE2_OFFSET0x -#define ENV2_SIZE 0x4000 -#define DEVICE2_ESIZE 0x4000 -#define DEVICE2_ENVSECTORS 2 +#include config.h -#define CONFIG_BAUDRATE 115200 -#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ -#define CONFIG_BOOTCOMMAND \ - bootp; \
Re: [U-Boot] [PATCH] fw_env: use vars from the board config
Cc u-boot ML please. 2012/1/2 Marek Vasut marek.va...@gmail.com it is quite odd that fw_printenv/fw_setenv does not use the settings from include/configs but instead redefines things. This patch uses the variables from the config file The edit in fw_env.c is only needed to resolve a name clash Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com --- Note: this is more intended to get some feedback. (also to see if I am on the right track) I did test the changes locally. (and yes, I know there are some more things that could be cleaned up). --- tools/env/fw_env.c | 20 ++-- tools/env/fw_env.h | 36 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 996682e..6597fbf 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -79,7 +79,7 @@ static int dev_current; #define ENVSECTORS(i) envdevices[(i)].env_sectors #define DEVTYPE(i)envdevices[(i)].mtd_type -#define CONFIG_ENV_SIZE ENVSIZE(dev_current) +#define CFG_ENV_SIZE ENVSIZE(dev_current) NAK, don't change it to CFG_... for no reason! Why did you change it ? Just use ENVSIZE(dev_current) instead. I agree with that. As I wrote in the comment of the patch, this was mainly to get some feedback that I am on the right track. I've seen a number of places where the code of fw_env.c could be improved, but opted for minimal change for now, as for now I am mostly solicitating feedback on the changes in fw_env.h (and the actual reason for the change is that CONFIG_ENV_SIZE is defined here, but also in config.h, resulting in a naming config, a quick rename was the simplest way forward for now) Let's see what the others think And actually I feel that lines like: #define ENV1_SIZE CONFIG_ENV_SIZE in fw_env.h are somewhat pointless and it would be better to eliminate ENV1_SIZE completely. There are more cases like that. I'm happy to spent time on this, but only if it is felt to be useful and has any chance on being accepted. Best regards, Frans M ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/4] mmc: Implement central card-detection.
On Monday, January 2, 2012, Thierry Reding thierry.red...@avionic-design.de wrote: Btw, what's your take on Mike's comment: http://lists.denx.de/pipermail/u-boot/2011-December/114002.html I'm not sure how useful it would be to add this now. Tegra2 has an implementation that pretty much implements what Mike proposed, so I guess if anyone else wants to add such a generic implementation, Tegra2 could serve as reference (and could itself be refactored on top of that). Or would you rather prefer to add that change in this series as well? I'm ok if it gets added later. I think it's a good idea to support generic gpio card detection, but I'm not familiar enough with U-Boot's GPIO support to be able to make more specific comments. Barring any objections, I intend to apply these patches in the next few hours. Thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, arm-kirkwood: disable l2c before linux boot
Am Mittwoch 21 Dezember 2011, 00:35:46 schrieb Michael Walle: The decompressor expects the L2 cache to be disabled. This fixes booting some kernels, which have CONFIG_ARM_PATCH_PHYS_VIRT enabled. Ping :) -- Michael ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] kirkwood_spi: fix setting of irq mask
Am Sonntag 18 Dezember 2011, 02:57:01 schrieb Prafulla Wadaskar: -Original Message- From: Michael Walle [mailto:mich...@walle.cc] Sent: 17 December 2011 09:31 To: u-boot@lists.denx.de Cc: Albert ARIBAUD; Prafulla Wadaskar; Wolfgang Denk Subject: Re: [PATCH] kirkwood_spi: fix setting of irq mask Am Samstag 17 Dezember 2011, 18:28:05 schrieb Michael Walle: Since the data alignment fault was enabled recently in commit arm, arm926ejs: always do cpu critical inits the driver won't work anymore and all boards which use an environment in an SPI flash will fail booting. Sorry i don't know how you track patches that should be applied for the RC. But IMHO this is one :) Thanks Michael I will take care of that. Ping :) -- Michael ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Input: keyboard - add device tree bindings for simple key matrixes
Hi Olof, On Sun, Jan 1, 2012 at 10:09 PM, Olof Johansson o...@lixom.net wrote: This adds a simple device tree binding for simple key matrix data and a helper to fill in the platform data. The implementation is in a shared file outside if drivers/input/keyboard since some drivers in drivers/input/misc might be making use of it as well. Changes since v2: * Removed reference to legacy format with a subnode per key * Changed to a packed format with one cell per key instead of 3. * Moved new OF helper to separate file * Misc fixups based on comments Changes since v1: * Removed samsung-style binding support * Added linux,fn-keymap and linux,fn-key optional properties Signed-off-by: Olof Johansson o...@lixom.net --- .../devicetree/bindings/input/matrix-keymap.txt | 27 ++ drivers/input/Kconfig | 4 + drivers/input/Makefile | 1 + drivers/input/keyboard/Kconfig | 1 + drivers/input/of_keymap.c | 87 include/linux/input/matrix_keypad.h | 19 6 files changed, 139 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/matrix-keymap.txt create mode 100644 drivers/input/of_keymap.c diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.txt b/Documentation/devicetree/bindings/input/matrix-keymap.txt new file mode 100644 index 000..1db8e12 --- /dev/null +++ b/Documentation/devicetree/bindings/input/matrix-keymap.txt @@ -0,0 +1,27 @@ +A simple common binding for matrix-connected key boards. Currently targeted at +defining the keys in the scope of linux key codes since that is a stable and +standardized interface at this time. + +Required properties: +- compatible: matrix-keyboard-controller +- linux,keymap: an array of packed 1-cell entries containing the equivalent + of row, column and linux key-code. The 32-bit big endian cell is packed + as: + row 24 | column 16 | key-code This looks much better than the Samsung binding and the original 3-cell one. U-Boot Tegra (keyboard patch series) currently uses a 16x8 matrix, and uses a single byte (the ASCII character) for a total of 128 bytes per keymap. Since U-Boot does not have (or apparently want) the concept of key codes or the added code and intermediate data this requires, the binding presented here will not suit U-Boot so far. These rows and columns embedded in the cell make it more of a pain to write the fdt description. If you just set up the cells in (column, row) order and set the matrix size (rows, columns) then you end up with 128 entries on Tegra. If you use uint16 then this could be 256 bytes instead of 512. The binding you present for Tegra would be 109 * 4 = 436 bytes. However I take your point that Fn maps are much more sparse, so overall this is likely to be similar (512 bytes for either method once Fn mappings are taken into account). But going back to U-Boot, it does not have the intermediate table that you malloc and decant into, it does not understand key codes so doesn't know what to do when Shift is pressed, doesn't understand languages, etc. In order to use these Linux bindings in U-Boot we would need to add new input layer, extra decode code and intermediate tables. I can almost hear the NAKs already (bear in mind fdt only went into U-Boot in the December release and people are more sensitive to code size / performance there than in Linux). I did ask about this on this list a few weeks ago but no response yet. We could perhaps add an alternative direct ASCII binding like this example (which would have to be in a separate node): /* Use a packed binding which doesn't include row,column numbers in each cell */ packed-binding; matrix-columns = 8; matrix-rows = 16; ascii-binding; /* ASCII characters instead of keycodes */ u-boot,keymap = /size/ 8 00 00 'w' 's' 'a' 'z' 00 DE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '5' '4' 'r' 'e' 'f' 'd' 'x' 00 '7' '6' 't' 'h' 'g' 'v' 'c' ' ' '9' '8' 'u' 'y' 'j' 'n' 'b' 5C '-' '0' 'o' 'i' 'l' 'k' ',' 'm' 00 '=' ']' 0D 00 00 00 00 00 00 00 00 DF DF 00 00 00 00 00 00 00 DC 00 DD 00 00 00 00 00 00 00 00 '[' 'p' 27 ';' '/' '.' 00 00 00 00 08 '3' '2' 1E 00 00 00 7F 00 00 00 1D 1F 1C 00
[U-Boot] [PATCH] fat: reset VFAT short alias checksum on first match
The VFAT short alias checksum read from a long file name is only overwritten when another long file name appears in a directory list. Until then it renders short file names invisible that have the same checksum. Reset the checksum on first match. Signed-off-by: Sergei Shtylyov sshtyl...@ru.mvista.com Signed-off-by: Martin Mueller martin.muell...@de.bosch.com --- fs/fat/fat.c |2 ++ 1 file changed, 2 insertions(+) Index: u-boot/fs/fat/fat.c === --- u-boot.orig/fs/fat/fat.c +++ u-boot/fs/fat/fat.c @@ -633,6 +633,7 @@ static dir_entry *get_dentfromdir (fsdat } #ifdef CONFIG_SUPPORT_VFAT if (dols mkcksum(dentptr-name) == prevcksum) { + prevcksum = 0x; dentptr++; continue; } @@ -963,6 +964,7 @@ do_fat_read (const char *filename, void #ifdef CONFIG_SUPPORT_VFAT else if (dols == LS_ROOT mkcksum(dentptr-name) == prevcksum) { + prevcksum = 0x; dentptr++; continue; } ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH resend] OMAP3: Remove unused define CONFIG_OMAP3_*_DDR
This patch removes the unused definitions: CONFIG_OMAP3_MICRON_DDR CONFIG_OMAP3_NUMONYX_DDR CONFIG_OMAP3_INFINEON_DDR Acked-by: Igor Grinberg grinb...@compulab.co.il Acked-by: Luca Ceresoli luca.ceres...@comelit.it Signed-off-by: Thomas Weber we...@corscience.de --- Changes: Added received acked-by's include/configs/cm_t35.h|3 --- include/configs/dig297.h|3 --- include/configs/igep0020.h |3 --- include/configs/igep0030.h |3 --- include/configs/omap3_mvblx.h |3 --- include/configs/omap3_overo.h |3 --- include/configs/omap3_pandora.h |3 --- include/configs/omap3_sdp3430.h |3 --- include/configs/omap3_zoom1.h |3 --- include/configs/omap3_zoom2.h |3 --- 10 files changed, 0 insertions(+), 30 deletions(-) diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h index a06a89d..0385ee8 100644 --- a/include/configs/cm_t35.h +++ b/include/configs/cm_t35.h @@ -112,9 +112,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR1 - /* USB */ #define CONFIG_MUSB_UDC1 #define CONFIG_USB_OMAP3 1 diff --git a/include/configs/dig297.h b/include/configs/dig297.h index 42aab27..1626b0e 100644 --- a/include/configs/dig297.h +++ b/include/configs/dig297.h @@ -109,9 +109,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR - /* library portions to compile in */ #define CONFIG_RBTREE #define CONFIG_MTD_PARTITIONS diff --git a/include/configs/igep0020.h b/include/configs/igep0020.h index 56fd6de..c2fcdff 100644 --- a/include/configs/igep0020.h +++ b/include/configs/igep0020.h @@ -78,9 +78,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR */ -#define CONFIG_OMAP3_NUMONYX_DDR 1 - /* USB */ #define CONFIG_MUSB_UDC1 #define CONFIG_USB_OMAP3 1 diff --git a/include/configs/igep0030.h b/include/configs/igep0030.h index 3634618..bf39ba5 100644 --- a/include/configs/igep0030.h +++ b/include/configs/igep0030.h @@ -78,9 +78,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR */ -#define CONFIG_OMAP3_NUMONYX_DDR 1 - /* USB */ #define CONFIG_MUSB_UDC1 #define CONFIG_USB_OMAP3 1 diff --git a/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h index eb51ea9..a5746d1 100644 --- a/include/configs/omap3_mvblx.h +++ b/include/configs/omap3_mvblx.h @@ -102,9 +102,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR1 - /* USB */ #define CONFIG_MUSB_UDC1 #define CONFIG_USB_OMAP3 1 diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h index 79eb466..db453ac 100644 --- a/include/configs/omap3_overo.h +++ b/include/configs/omap3_overo.h @@ -90,9 +90,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR1 - /* commands to include */ #include config_cmd_default.h diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h index 1a30454..4df5f5d 100644 --- a/include/configs/omap3_pandora.h +++ b/include/configs/omap3_pandora.h @@ -104,9 +104,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR1 - /* commands to include */ #include config_cmd_default.h diff --git a/include/configs/omap3_sdp3430.h b/include/configs/omap3_sdp3430.h index 90f4b90..404aed2 100644 --- a/include/configs/omap3_sdp3430.h +++ b/include/configs/omap3_sdp3430.h @@ -137,9 +137,6 @@ #define CONFIG_SYS_I2C_BUS_SELECT 1 #define CONFIG_DRIVER_OMAP34XX_I2C 1 -/* DDR - I use Infineon DDR */ -#define CONFIG_OMAP3_INFINEON_DDR 1 - /* OMITTED: single 1 Gbit MT29F1G NAND flash */ /* diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h index b0e10c7..17608f5 100644 --- a/include/configs/omap3_zoom1.h +++ b/include/configs/omap3_zoom1.h @@ -99,9 +99,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 -/* DDR - I use Micron DDR */ -#define CONFIG_OMAP3_MICRON_DDR1 - /* USB */ #define CONFIG_MUSB_UDC1 #define CONFIG_USB_OMAP3 1 diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h index 8a37ebf..b60ece3 100644 --- a/include/configs/omap3_zoom2.h +++ b/include/configs/omap3_zoom2.h @@ -99,9 +99,6 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION
[U-Boot] [PATCH] lsxl: add support for lschlv2 and lsxhl
This patchset adds support for both the Linkstation Live (LS-CHLv2) and Linkstation Pro (LS-XHL) by Buffalo. Signed-off-by: Michael Walle mich...@walle.cc Cc: Prafulla Wadaskar prafu...@marvell.com --- MAINTAINERS |4 + board/Marvell/lsxl/Makefile | 50 +++ board/Marvell/lsxl/config.mk |1 + board/Marvell/lsxl/kwbimage-lschl.cfg | 66 + board/Marvell/lsxl/kwbimage-lsxhl.cfg | 66 + board/Marvell/lsxl/lsxl.c | 233 + board/Marvell/lsxl/lsxl.h | 75 +++ boards.cfg|3 + include/configs/lsxl.h| 175 + 9 files changed, 673 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/lsxl/Makefile create mode 100644 board/Marvell/lsxl/config.mk create mode 100644 board/Marvell/lsxl/kwbimage-lschl.cfg create mode 100644 board/Marvell/lsxl/kwbimage-lsxhl.cfg create mode 100644 board/Marvell/lsxl/lsxl.c create mode 100644 board/Marvell/lsxl/lsxl.h create mode 100644 include/configs/lsxl.h diff --git a/MAINTAINERS b/MAINTAINERS index a56ca10..f55cd3b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -876,6 +876,10 @@ Prafulla Wadaskar prafu...@marvell.com rd6281a ARM926EJS (Kirkwood SoC) sheevaplug ARM926EJS (Kirkwood SoC) +Michael Walle mich...@walle.cc + + lsxlARM926EJS (Kirkwood SoC) + Tom Warren twar...@nvidia.com harmony Tegra2 (ARM7 A9 Dual Core) diff --git a/board/Marvell/lsxl/Makefile b/board/Marvell/lsxl/Makefile new file mode 100644 index 000..4c08079 --- /dev/null +++ b/board/Marvell/lsxl/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (c) 2011 Michael Walle +# Michael Walle mich...@walle.cc +# +# 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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := lsxl.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/Marvell/lsxl/config.mk b/board/Marvell/lsxl/config.mk new file mode 100644 index 000..062554b --- /dev/null +++ b/board/Marvell/lsxl/config.mk @@ -0,0 +1 @@ +ALL-y += $(obj)u-boot.kwb diff --git a/board/Marvell/lsxl/kwbimage-lschl.cfg b/board/Marvell/lsxl/kwbimage-lschl.cfg new file mode 100644 index 000..4d96c3f --- /dev/null +++ b/board/Marvell/lsxl/kwbimage-lschl.cfg @@ -0,0 +1,66 @@ +# +# Copyright (c) 2011 Michael Walle +# Michael Walle mich...@walle.cc +# +# 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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi # Boot from SPI flash + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100E0 0x1B1B1B9B + +DATA 0xFFD20134 0x # L2 RAM Timing 0
Re: [U-Boot] [PATCH] lsxl: add support for lschlv2 and lsxhl
Dear Michael Walle, In message 1325545909-17678-1-git-send-email-mich...@walle.cc you wrote: This patchset adds support for both the Linkstation Live (LS-CHLv2) and Linkstation Pro (LS-XHL) by Buffalo. If Buffalo is the vendor, then why do you add this to the Marvell vendor directory? +Michael Walle mich...@walle.cc + + lsxlARM926EJS (Kirkwood SoC) You add two boards, so please also maintain both. +#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F62811 /* SOC Name */ Please don't define values for macros that select featues only. Please fix globally. +#ifdef CONFIG_SPI_FLASH +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#define CONFIG_SYS_MAX_FLASH_SECT 8 +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE0x1 /* 64K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +#define CONFIG_ENV_SIZE 0x1 /* 64k */ +#define CONFIG_ENV_OFFSET 0x7 /* env starts here */ Please use TABs only for vertical alignment. Please fix globally. +#define CONFIG_ETHADDR 02:00:01:00:00:00 ... +#define CONFIG_IPADDR192.168.11.150 +#define CONFIG_SERVERIP 192.168.11.1 +#define CONFIG_NETMASK 255.255.255.0 NAK. We do not allow such static network configurations. +#define CONFIG_BOOTARGS console=ttyS0,115200 root=/dev/sda2 \ + netconsole=@MK_STR(CONFIG_IPADDR)/eth1 +#define CONFIG_EXTRA_ENV_SETTINGS \ + bootsource=hdd\0 \ + hdpart=0:1\0 \ + bootcmd_net=tftpboot 0x0010 uImage; \ + tftpboot 0x0080 uInitrd; \ + bootm 0x0010 0x0080\0\ + bootcmd_hdd=ide reset; ext2load ide ${hdpart} 0x0010 /uImage;\ + ext2load ide ${hdpart} 0x0080 /uInitrd; \ + bootm 0x0010 0x0080\0\ Indentation by TAB only, please. Please fix globally. 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 The more sins you confess, the more books you will sell. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] lsxl: add support for lschlv2 and lsxhl
Hi Wolfgang, quick answer ;) In message 1325545909-17678-1-git-send-email-mich...@walle.cc you wrote: This patchset adds support for both the Linkstation Live (LS-CHLv2) and Linkstation Pro (LS-XHL) by Buffalo. If Buffalo is the vendor, then why do you add this to the Marvell vendor directory? I was just guessing. It is a Marvell SoC and marvell SoC boards of other vendors are in the Marvell/ directory, too. But i'm also happy with Buffalo/ (or buffalo/?). +Michael Walle mich...@walle.cc + + lsxlARM926EJS (Kirkwood SoC) You add two boards, so please also maintain both. oops sorry. +#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F62811 /* SOC Name */ Please don't define values for macros that select featues only. Please fix globally. ok +#ifdef CONFIG_SPI_FLASH +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#define CONFIG_SYS_MAX_FLASH_SECT 8 +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE0x1 /* 64K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +#define CONFIG_ENV_SIZE 0x1 /* 64k */ +#define CONFIG_ENV_OFFSET 0x7 /* env starts here */ Please use TABs only for vertical alignment. Please fix globally. ok +#define CONFIG_ETHADDR 02:00:01:00:00:00 ... +#define CONFIG_IPADDR 192.168.11.150 +#define CONFIG_SERVERIP192.168.11.1 +#define CONFIG_NETMASK 255.255.255.0 NAK. We do not allow such static network configurations. i've already guessed that ;) you may remember our lengthy discussions about the board which don't have a dedicated NVRAM for the ethernet address. Well, this is such a board. I would have expected more responses from other maintainers of this type of boards, esp. after the patch which removes the mac randomization from the ethernet driver, was merged. So if #define CONFIG_ETHADDR xxx #define CONFIG_OVERWRITE_ETHADDR_ONCE is a no-no (i really dont see the point, why it's not allowed, sorry), i guess i have to maintain this on my own tree :( -- Michael ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it
Hi Graham, On Mon, Jan 2, 2012 at 3:26 AM, Graeme Russ graeme.r...@gmail.com wrote: Hi Simon, In case you haven't noticed (I did not Cc you or Wolfgang, sorry 'bout that) I've posted the cleaned up version of my x86 init refactoring... Yes I see it - thats great thanks. I will go through it and compare. [big snip] functions. Now this is better than where we are now, but my original complaint was that I want to be able to add features to a single place and have them work across all architectures. With your end-result I still need to figure out where to put the new feature in each initcall list and create 10 patches, one for each arch, to plumb it in. Agree, and my ultimate end goal (as per my previous initcall patch series) is to remove the per-arch init list as well... Well since it seems we are going for the same goal, and you are actively submitting patches towards it, I'm very happy. I mostly agree with your points, so will not respond bit by bit. The easiest route to the goal is the right one, so let's run with what you propose and see how we go. Thanks for taking it up. [another big snip] I had a go at bringing PPC into the generic board patches. Apart from the cloud of #ifdefs as expected it is not too bad. And those can be dealt with by initcalls. Am hoping we can get there soon! Regards, Simon Regards, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it
Hi Wolfgang, On Mon, Jan 2, 2012 at 6:46 AM, Wolfgang Denk w...@denx.de wrote: Dear Graeme Russ, In message 4f019473.8000...@gmail.com you wrote: The problem is not one of how sparsely the test/fix cycles are spread over time, it is one of spreading the breakage over multiple patches - If you are replacing functionality then add the new functionality, add the hooks to use it and delete the old in a single patch. That way, if you change breaks something, the revert is trivial. If you multi-patch approach breaks something, the revert becomes more difficult. True. Especially as it's likely that different patches will break different boards, so there will not even be a chance so revert. The only option would be to have a way to use the legacy code for particular boards (say a CONFIG option) until they are fixed. Not entirely satisfactory. Of course this could happen with either approach, and reverts become impossible when further patches are layered on top. Well I don't propose to create things which are not bisect-able. I But you have - You create new functionality in one patch, add a number of patches, then finally use that new functionality in a later patch. This is what I fear as well. Well let's see how we go with the incremental approach - hopefully we can get the same result with less pain and risk, and not too much work. Regards, Simon 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 Disc space - the final frontier! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/6] cm-t35: cleanup the config file
On 01/02/12 16:01, Igor Grinberg wrote: From: Nikita Kiryanov nik...@compulab.co.il Remove values from boolean defines, fix indentation, etc.. No functional changes. Signed-off-by: Nikita Kiryanov nik...@compulab.co.il Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- Forgot to mention that this patch depends on Thomas' clean up patch, either [1] or [2] (they are the same). [1] http://patchwork.ozlabs.org/patch/133915/ [2] http://patchwork.ozlabs.org/patch/131793/ -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/3] ARM:AM33XX: Fix ddr and timer register offset
This patch is added to update incorrect ddr, pll and timer register offset along with some additional cleanup like removing unused code. Also, generic CONFIG_AM33XX symbol is added for AM33XX platform. Signed-off-by: Chandan Nath chandan.n...@ti.com Signed-off-by: Tom Rini tr...@ti.com --- Changes since v2: - No change Changes since v1: - Changed CONFIG_AM335X to CONFIG_AM33XX - Rebased to master branch Makefile|2 +- arch/arm/cpu/armv7/am33xx/board.c |8 ++-- arch/arm/cpu/armv7/am33xx/clock.c |3 ++ arch/arm/include/asm/arch-am33xx/cpu.h | 44 ++- arch/arm/include/asm/arch-am33xx/ddr_defs.h |6 ++-- include/configs/am335x_evm.h| 13 ++- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 0438f1e..1f90afa 100644 --- a/Makefile +++ b/Makefile @@ -294,7 +294,7 @@ LIBS += lib/libfdt/libfdt.o LIBS += api/libapi.o LIBS += post/libpost.o -ifneq ($(CONFIG_AM335X)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) +ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 2d6d359..78db3a5 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR; struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE; -struct timer_reg *timerreg = (struct timer_reg *)DM_TIMER2_BASE; +struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE; /* * early system init of muxing and clocks. @@ -55,12 +55,12 @@ void s_init(u32 in_ddr) void init_timer(void) { /* Reset the Timer */ - writel(0x2, (timerreg-tsicrreg)); + writel(0x2, (timer_base-tscir)); /* Wait until the reset is done */ - while (readl(timerreg-tiocpcfgreg) 1) + while (readl(timer_base-tiocp_cfg) 1) ; /* Start the Timer */ - writel(0x1, (timerreg-tclrreg)); + writel(0x1, (timer_base-tclr)); } diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c index 4ca6c45..7070e7d 100644 --- a/arch/arm/cpu/armv7/am33xx/clock.c +++ b/arch/arm/cpu/armv7/am33xx/clock.c @@ -101,6 +101,9 @@ static void enable_per_clocks(void) while (readl(cmper-timer2clkctrl) != PRCM_MOD_EN) ; + /* Select the Master osc 24 MHZ as Timer2 clock source */ + writel(0x1, cmdpll-clktimer2clk); + /* UART0 */ writel(PRCM_MOD_EN, cmwkup-wkup_uart0ctrl); while (readl(cmwkup-wkup_uart0ctrl) != PRCM_MOD_EN) diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h b/arch/arm/include/asm/arch-am33xx/cpu.h index ad9156e..25558a2 100644 --- a/arch/arm/include/asm/arch-am33xx/cpu.h +++ b/arch/arm/include/asm/arch-am33xx/cpu.h @@ -51,7 +51,7 @@ | BIT(3) | BIT(4)) /* Reset control */ -#ifdef CONFIG_AM335X +#ifdef CONFIG_AM33XX #define PRM_RSTCTRL0x44E00F00 #endif #define PRM_RSTCTRL_RESET 0x01 @@ -108,22 +108,36 @@ struct cm_perpll { unsigned int l3sclkstctrl; /* offset 0x04 */ unsigned int l4fwclkstctrl; /* offset 0x08 */ unsigned int l3clkstctrl; /* offset 0x0c */ - unsigned int resv1[6]; + unsigned int resv1; + unsigned int cpgmac0clkctrl;/* offset 0x14 */ + unsigned int resv2[4]; unsigned int emifclkctrl; /* offset 0x28 */ unsigned int ocmcramclkctrl;/* offset 0x2c */ - unsigned int resv2[12]; + unsigned int gpmcclkctrl; /* offset 0x30 */ + unsigned int resv3[2]; + unsigned int mmc0clkctrl; /* offset 0x3C */ + unsigned int elmclkctrl;/* offset 0x40 */ + unsigned int i2c2clkctrl; /* offset 0x44 */ + unsigned int i2c1clkctrl; /* offset 0x48 */ + unsigned int spi0clkctrl; /* offset 0x4C */ + unsigned int spi1clkctrl; /* offset 0x50 */ + unsigned int resv4[3]; unsigned int l4lsclkctrl; /* offset 0x60 */ unsigned int l4fwclkctrl; /* offset 0x64 */ - unsigned int resv3[6]; + unsigned int resv5[6]; unsigned int timer2clkctrl; /* offset 0x80 */ - unsigned int resv4[19]; + unsigned int resv6[11]; + unsigned int gpio2clkctrl; /* offset 0xB0 */ + unsigned int resv7[7]; unsigned int emiffwclkctrl; /* offset 0xD0 */ - unsigned int resv5[2]; + unsigned int resv8[2]; unsigned int l3instrclkctrl;/* offset 0xDC */ unsigned int l3clkctrl; /* Offset 0xE0 */ - unsigned int resv6[14]; + unsigned int resv9[14]; unsigned int l4hsclkstctrl; /* offset 0x11C */ unsigned int l4hsclkctrl; /* offset 0x120 */ +
[U-Boot] [PATCH v3 2/3] ARM:AM33XX: Add mmc/sd support
This patch add supports for mmc/sd driver on AM335X platform. PLL and pinmux configurations for mmc/sd are configured in this patch. Signed-off-by: Chandan Nath chandan.n...@ti.com Signed-off-by: Tom Rini tr...@ti.com --- Changes since v2: - No change Changes since v1: - Removed unwanted code from omap_hsmmc.c file - Rebased to master branch arch/arm/cpu/armv7/am33xx/board.c |7 + arch/arm/cpu/armv7/am33xx/clock.c |5 + arch/arm/include/asm/arch-am33xx/mmc_host_def.h | 164 +++ board/ti/am335x/mux.c | 20 +++ include/configs/am335x_evm.h|9 ++ 5 files changed, 205 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-am33xx/mmc_host_def.h diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 78db3a5..312643c 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -64,3 +64,10 @@ void init_timer(void) /* Start the Timer */ writel(0x1, (timer_base-tclr)); } + +#if defined(CONFIG_OMAP_HSMMC) !defined(CONFIG_SPL_BUILD) +int board_mmc_init(bd_t *bis) +{ + return omap_mmc_init(0); +} +#endif diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c index 7070e7d..98cfd93 100644 --- a/arch/arm/cpu/armv7/am33xx/clock.c +++ b/arch/arm/cpu/armv7/am33xx/clock.c @@ -108,6 +108,11 @@ static void enable_per_clocks(void) writel(PRCM_MOD_EN, cmwkup-wkup_uart0ctrl); while (readl(cmwkup-wkup_uart0ctrl) != PRCM_MOD_EN) ; + + /* MMC0*/ + writel(PRCM_MOD_EN, cmper-mmc0clkctrl); + while (readl(cmper-mmc0clkctrl) != PRCM_MOD_EN) + ; } static void mpu_pll_config(void) diff --git a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h new file mode 100644 index 000..e56c018 --- /dev/null +++ b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h @@ -0,0 +1,164 @@ +/* + * mmc_host_def.h + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * 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 version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef MMC_HOST_DEF_H +#define MMC_HOST_DEF_H + +/* + * OMAP HSMMC register definitions + */ +#define OMAP_HSMMC1_BASE 0x48060100 +#define OMAP_HSMMC2_BASE 0x481D8000 +#define OMAP_HSMMC3_BASE 0x47C24000 + +typedef struct hsmmc { + unsigned char res1[0x10]; + unsigned int sysconfig; /* 0x10 */ + unsigned int sysstatus; /* 0x14 */ + unsigned char res2[0x14]; + unsigned int con; /* 0x2C */ + unsigned char res3[0xD4]; + unsigned int blk; /* 0x104 */ + unsigned int arg; /* 0x108 */ + unsigned int cmd; /* 0x10C */ + unsigned int rsp10; /* 0x110 */ + unsigned int rsp32; /* 0x114 */ + unsigned int rsp54; /* 0x118 */ + unsigned int rsp76; /* 0x11C */ + unsigned int data; /* 0x120 */ + unsigned int pstate;/* 0x124 */ + unsigned int hctl; /* 0x128 */ + unsigned int sysctl;/* 0x12C */ + unsigned int stat; /* 0x130 */ + unsigned int ie;/* 0x134 */ + unsigned char res4[0x8]; + unsigned int capa; /* 0x140 */ +} hsmmc_t; + +/* + * OMAP HS MMC Bit definitions + */ +#define MMC_SOFTRESET (0x1 1) +#define RESETDONE (0x1 0) +#define NOOPENDRAIN(0x0 0) +#define OPENDRAIN (0x1 0) +#define OD (0x1 0) +#define INIT_NOINIT(0x0 1) +#define INIT_INITSTREAM(0x1 1) +#define HR_NOHOSTRESP (0x0 2) +#define STR_BLOCK (0x0 3) +#define MODE_FUNC (0x0 4) +#define DW8_1_4BITMODE (0x0 5) +#define MIT_CTO(0x0 6) +#define CDP_ACTIVEHIGH (0x0 7) +#define WPP_ACTIVEHIGH (0x0 8) +#define RESERVED_MASK (0x3 9) +#define CTPL_MMC_SD(0x0 11) +#define BLEN_512BYTESLEN (0x200 0) +#define NBLK_STPCNT(0x0 16) +#define DE_DISABLE (0x0 0) +#define BCE_DISABLE(0x0 1) +#define BCE_ENABLE (0x1 1)
[U-Boot] [PATCH v3 0/3] Added SPL support
This patch series is submitted to add support for MMC/SD along with SPL support. Also, fixed incorrect register offset of ddr and timer registers. The patches have been compile tested and run on AM335X EVM. The patches depends on previous patch series which was submitted for supporting AM33xx platform. The patches are applies on uboot master branch. Changes since v2: - Added missing omap.h file in Add SPL support for AM335X EVM patch Changes since v1: - Removed unwanted code from omap_hsmmc.c file - Changed CONFIG_AM335X to CONFIG_AM33XX - Rebased to master branch - Replaced am33xx lowleve_init.S with omap-common lowlevel_init.S in order to use common code for omap_bootmode. Chandan Nath (3): ARM:AM33XX: Fix ddr and timer register offset ARM:AM33XX: Add mmc/sd support ARM:AM33XX: Add SPL support for AM335X EVM Makefile|2 +- arch/arm/cpu/armv7/am33xx/Makefile |2 - arch/arm/cpu/armv7/am33xx/board.c | 80 ++- arch/arm/cpu/armv7/am33xx/clock.c |8 + arch/arm/cpu/armv7/am33xx/config.mk | 18 +++ arch/arm/cpu/armv7/am33xx/emif4.c |2 +- arch/arm/cpu/armv7/am33xx/lowlevel_init.S | 72 -- arch/arm/cpu/armv7/omap-common/Makefile |3 + arch/arm/include/asm/arch-am33xx/common_def.h | 22 +++ arch/arm/include/asm/arch-am33xx/cpu.h | 44 +++--- arch/arm/include/asm/arch-am33xx/ddr_defs.h |6 +- arch/arm/include/asm/arch-am33xx/mmc_host_def.h | 164 +++ arch/arm/include/asm/arch-am33xx/omap.h | 59 arch/arm/include/asm/arch-am33xx/sys_proto.h|1 + arch/arm/include/asm/omap_common.h |5 + board/ti/am335x/common_def.h| 24 board/ti/am335x/evm.c |2 +- board/ti/am335x/mux.c | 22 +++- include/configs/am335x_evm.h| 61 +++-- spl/Makefile| 13 +- 20 files changed, 457 insertions(+), 153 deletions(-) create mode 100644 arch/arm/cpu/armv7/am33xx/config.mk delete mode 100644 arch/arm/cpu/armv7/am33xx/lowlevel_init.S create mode 100644 arch/arm/include/asm/arch-am33xx/common_def.h create mode 100644 arch/arm/include/asm/arch-am33xx/mmc_host_def.h create mode 100644 arch/arm/include/asm/arch-am33xx/omap.h delete mode 100644 board/ti/am335x/common_def.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 3/3] ARM:AM33XX: Add SPL support for AM335X EVM
This patch is added to support SPL feature on AM335X platform. In this patch, MMC1 is configured as boot device for SPL and support for other devices will be added in the next patch series. Signed-off-by: Chandan Nath chandan.n...@ti.com Signed-off-by: Tom Rini tr...@ti.com --- Changes since v2: - Added missing omap.h file Changes since v1: - Rebased to master branch - Replaced am33xx lowleve_init.S with omap-common lowlevel_init.S in order to use common code for omap_bootmode. arch/arm/cpu/armv7/am33xx/Makefile|2 - arch/arm/cpu/armv7/am33xx/board.c | 65 +-- arch/arm/cpu/armv7/am33xx/config.mk | 18 ++ arch/arm/cpu/armv7/am33xx/emif4.c |2 +- arch/arm/cpu/armv7/am33xx/lowlevel_init.S | 72 - arch/arm/cpu/armv7/omap-common/Makefile |3 + arch/arm/include/asm/arch-am33xx/common_def.h | 22 arch/arm/include/asm/arch-am33xx/omap.h | 59 arch/arm/include/asm/arch-am33xx/sys_proto.h |1 + arch/arm/include/asm/omap_common.h|5 ++ board/ti/am335x/common_def.h | 24 board/ti/am335x/evm.c |2 +- board/ti/am335x/mux.c |2 +- include/configs/am335x_evm.h | 39 - spl/Makefile | 13 ++--- 15 files changed, 214 insertions(+), 115 deletions(-) create mode 100644 arch/arm/cpu/armv7/am33xx/config.mk delete mode 100644 arch/arm/cpu/armv7/am33xx/lowlevel_init.S create mode 100644 arch/arm/include/asm/arch-am33xx/common_def.h create mode 100644 arch/arm/include/asm/arch-am33xx/omap.h delete mode 100644 board/ti/am335x/common_def.h diff --git a/arch/arm/cpu/armv7/am33xx/Makefile b/arch/arm/cpu/armv7/am33xx/Makefile index 6beafbb..7768912 100644 --- a/arch/arm/cpu/armv7/am33xx/Makefile +++ b/arch/arm/cpu/armv7/am33xx/Makefile @@ -16,8 +16,6 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(SOC).o -SOBJS := lowlevel_init.o - COBJS += clock.o COBJS += sys_info.o COBJS += ddr.o diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 312643c..2a45933 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -19,19 +19,45 @@ #include common.h #include asm/arch/cpu.h #include asm/arch/hardware.h +#include asm/arch/omap.h #include asm/arch/ddr_defs.h #include asm/arch/clock.h +#include asm/arch/mmc_host_def.h +#include asm/arch/common_def.h #include asm/io.h +#include asm/omap_common.h DECLARE_GLOBAL_DATA_PTR; struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE; struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE; +struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE; + +struct omap_boot_parameters boot_params __attribute__ ((section(.data))); + +#ifdef CONFIG_SPL_BUILD +u32 omap_bootmode = MMCSD_MODE_FAT; + +u32 omap_boot_device(void) +{ + return (u32) (boot_params.omap_bootdevice); +} + +u32 omap_boot_mode(void) +{ + return omap_bootmode; +} + +/* UART Defines */ +#define UART_RESET (0x1 1) +#define UART_CLK_RUNNING_MASK 0x1 +#define UART_SMART_IDLE_EN (0x1 0x3) +#endif /* * early system init of muxing and clocks. */ -void s_init(u32 in_ddr) +void s_init(void) { /* WDT1 is already running when the bootloader gets control * Disable it to avoid random resets @@ -43,12 +69,37 @@ void s_init(u32 in_ddr) while (readl(wdtimer-wdtwwps) != 0x0) ; +#ifdef CONFIG_SPL_BUILD /* Setup the PLLs and the clocks for the peripherals */ -#ifdef CONFIG_SETUP_PLL pll_init(); + + /* UART softreset */ + u32 regVal; + + enable_uart0_pin_mux(); + + regVal = readl(uart_base-uartsyscfg); + regVal |= UART_RESET; + writel(regVal, uart_base-uartsyscfg); + while ((readl(uart_base-uartsyssts) + UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK) + ; + + /* Disable smart idle */ + regVal = readl(uart_base-uartsyscfg); + regVal |= UART_SMART_IDLE_EN; + writel(regVal, uart_base-uartsyscfg); + + /* Initialize the Timer */ + init_timer(); + + preloader_console_init(); + + config_ddr(); #endif - if (!in_ddr) - config_ddr(); + + /* Enable MMC0 */ + enable_mmc0_pin_mux(); } /* Initialize timer */ @@ -71,3 +122,9 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0); } #endif + +void setup_clocks_for_console(void) +{ + /* Not yet implemented */ + return; +} diff --git a/arch/arm/cpu/armv7/am33xx/config.mk b/arch/arm/cpu/armv7/am33xx/config.mk new file mode 100644 index 000..5750bbd --- /dev/null +++ b/arch/arm/cpu/armv7/am33xx/config.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
Re: [U-Boot] [PATCH] lsxl: add support for lschlv2 and lsxhl
On Tue, January 3, 2012 00:55, Wolfgang Denk wrote: +#define CONFIG_ETHADDR 02:00:01:00:00:00 ... +#define CONFIG_IPADDR 192.168.11.150 +#define CONFIG_SERVERIP 192.168.11.1 +#define CONFIG_NETMASK 255.255.255.0 NAK. We do not allow such static network configurations. Ok, heres another idea: If i had a special rescue mode, started by lets say, pushing a button on startup, which then sets this fixed mac address (and other things like serial to netconsole etc), would that be acked by you? -- michael ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot