[U-Boot] [PATCH] gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation
The implementation of gpio_is_valid() has inversed logic, fix it. Signed-off-by: Axel Lin --- Hi, I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch. Axel drivers/gpio/altera_pio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c index fb03760..7ab6df8 100644 --- a/drivers/gpio/altera_pio.c +++ b/drivers/gpio/altera_pio.c @@ -294,6 +294,6 @@ int gpio_is_valid(int number) int gidx = altera_pio_gidx(number); if (gidx < 0) - return 1; - return 0; + return 0; + return 1; } -- 1.8.1.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] gpio: s3c2440_gpio: Fix wrong writel arguments
Current code had writel arguments the wrong way around, fix it. Signed-off-by: Axel Lin --- Hi, I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch. Axel drivers/gpio/s3c2440_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c index 43bbf11..09b04eb 100644 --- a/drivers/gpio/s3c2440_gpio.c +++ b/drivers/gpio/s3c2440_gpio.c @@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value) else l &= ~bit; - return writel(port, l); + return writel(l, port); } int gpio_get_value(unsigned gpio) @@ -85,11 +85,11 @@ int gpio_free(unsigned gpio) int gpio_direction_input(unsigned gpio) { - return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio)); + return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); } int gpio_direction_output(unsigned gpio, int value) { - writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio)); + writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); return gpio_set_value(gpio, value); } -- 1.8.1.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] gpio: s3c2440_gpio: Fix wrong writel arguments
Dear Axel Lin, > Current code had writel arguments the wrong way around, fix it. > > Signed-off-by: Axel Lin > --- > Hi, > I don't have this hardware to test, but current code looks obviously wrong. > I'd appreciate if someone can review and test this patch. > > Axel > drivers/gpio/s3c2440_gpio.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Reviewed-by: Marek Vasut Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114
Dear Thierry Reding, > On Fri, Jun 14, 2013 at 06:41:40PM +0800, Jim Lin wrote: > > Add DT node for USB EHCI function. > > Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards. > > > > Signed-off-by: Jim Lin > > Hi Jim, > > none of the patches in this series have a changelog that list the > changes between v1 to v2. It's customary to include one between the > separator and the diffstat (as pointed out below). That makes it easier > for people reviewing or testing your patches because they know what to > look for or test. Good point. Unless anyone is against this patchset, I'll pick it after I know what changed in this version. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] gpio: s5p_gpio: Call s5p_gpio_set_value() instead of open-code
Call s5p_gpio_set_value() to avoid code duplication. Signed-off-by: Axel Lin --- drivers/gpio/s5p_gpio.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index 656bf4a..4efb768 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -48,15 +48,8 @@ void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg) void s5p_gpio_direction_output(struct s5p_gpio_bank *bank, int gpio, int en) { - unsigned int value; - s5p_gpio_cfg_pin(bank, gpio, GPIO_OUTPUT); - - value = readl(&bank->dat); - value &= ~DAT_MASK(gpio); - if (en) - value |= DAT_SET(gpio); - writel(value, &bank->dat); + s5p_gpio_set_value(bank, gpio, en); } void s5p_gpio_direction_input(struct s5p_gpio_bank *bank, int gpio) -- 1.8.1.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-boot: Erase/read/write issue with S25fl256S flash device
On 14-06-2013 20:13, Sourav Poddar wrote: Hi Jagan, On Friday 14 June 2013 08:08 PM, Jagan Teki wrote: On 14-06-2013 20:03, Sourav Poddar wrote: Hi, On Wednesday 12 June 2013 01:00 PM, Sourav Poddar wrote: Hi, I am working on qspi flash device S25FL256S at u-boot level. I am trying to make use of the existing spi_flash.c framework available at u-boot for erasing/reading/writing into the flash device. There are several issues(mentioned below), which I faced while using S25FL256s flash device with my dra7xx board which has a qspi controller to which the above mentioned flash device is attached. 1. Erase (spi_flash_cmd_erase) Issuing a command something like this.. sf erase 0x0 0x5 - erases only first 0x2 bytes of flash device, anything above that is not erase. I need to issue separate commands after 0x2 for every 0x1 bytes. Am i missing anything here? 2. read sf read 8100 0 0x1 Read is not happening properly. The last few byte along the 4k boundary always shows zero. Above 4k bytes, read is not happening. For ex: DRA752 EVM # md 81000f00 81000f00: 81000f10: 81000f20: 81000f30: 81000f40: 81000f50: 81000f60: 81000f70: 81000f80: 81000f90: 81000fa0: 81000fb0: 81000fc0: 81000fd0: 81000fe0: 81000ff0: 00ff In this dump, if you see 81000ff0 the last column shows 00 which is not expected. and it happens along every 4k bytes. So, to get rid of the above issue, I switched to page read with the below patch[1], which is giving me the correct result. [1]: @@ -147,17 +153,40 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, size_t len, void *data) { - u8 cmd[5]; + unsigned long page_addr, byte_addr, page_size; + size_t chunk_len, actual; + int ret = 0; + u8 cmd[4]; /* Handle memory-mapped SPI */ if (flash->memory_map) memcpy(data, flash->memory_map + offset, len); + page_size = flash->page_size; + page_addr = offset / page_size; + byte_addr = offset % page_size; + + cmd[0] = CMD_READ_ARRAY_SLOW; + for (actual = 0; actual < len; actual += chunk_len) { + chunk_len = min(len - actual, page_size - byte_addr); + + cmd[1] = page_addr >> 8; + cmd[2] = page_addr; + cmd[3] = byte_addr; + + ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data + actual, chunk_len); + if (ret < 0) { + debug("SF: read failed"); + break; + } - cmd[0] = CMD_READ_ARRAY_FAST; - spi_flash_addr(offset, cmd); - cmd[4] = 0x00; + byte_addr += chunk_len; + if (byte_addr == page_size) { + page_addr++; + byte_addr = 0; + } + } - return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len); + return ret; } Any idea about this? 3. write (spi_flash_cmd_write_multi) write not happening properly. observations: only able to write single page, anything after a page is not getting written. Workaround: I did a write disable latch at the end of every write cycle(page program) and enable it again for the next loop. With this, I see I get rid of the above issue. @@ -117,6 +117,12 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset, if (ret) break; + ret = spi_flash_cmd_write_disable(flash); + if (ret < 0) { + printf("SF: disabling write failed\n"); + break; + } + Have anyone seen the above mentioned issues regarding read/write/erase? OR is there any configurations that I might be missing ? Any Input on this? Please wait, I am pushing some changes tonight or so. We will continue this thread, after testing your part with these new changes. I will intimate you once the push done. -- Thanks, Jagan. Thanks a lot for the repl
[U-Boot] [SPI-TEST]: Request for test u-boot-spi/master-work
Hi All, In-fact this is a first time for sending test tagged mail. The reason for sending this is: We added many changes on spi_flash framework to support all sizes of flashes. I'd appreciate if anyone can test this master-work branch on u-boot-spi.git repo with your respective hw's $ git clone git://git.denx.de/u-boot-spi.git $ cd u-boot-spi $ git checkout -b master-work origin/master-work Please let me know for any issues/concerns. Apologies, if anyone hurt this kind of mail. -- Thanks, Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] sf: Place the sf calls in proper order
Placed the sf calls in proper order - erase/write/read Signed-off-by: Jagannadha Sutradharudu Teki --- Changes for v2: - remove timeout arg in spi_flash_write_common drivers/mtd/spi/spi_flash.c | 184 ++-- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 80d2fe6..492a784 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -68,6 +68,51 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len, return spi_flash_read_write(spi, cmd, cmd_len, data, NULL, data_len); } +int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) +{ + struct spi_slave *spi = flash->spi; + unsigned long timebase; + int ret; + u8 status; + u8 check_status = 0x0; + u8 poll_bit = STATUS_WIP; + u8 cmd = flash->poll_cmd; + + if (cmd == CMD_FLAG_STATUS) { + poll_bit = STATUS_PEC; + check_status = poll_bit; + } + + ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN); + if (ret) { + debug("SF: fail to read %s status register\n", + cmd == CMD_READ_STATUS ? "read" : "flag"); + return ret; + } + + timebase = get_timer(0); + do { + WATCHDOG_RESET(); + + ret = spi_xfer(spi, 8, NULL, &status, 0); + if (ret) + return -1; + + if ((status & poll_bit) == check_status) + break; + + } while (get_timer(timebase) < timeout); + + spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END); + + if ((status & poll_bit) == check_status) + return 0; + + /* Timed out */ + debug("SF: time out!\n"); + return -1; +} + int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd, size_t cmd_len, const void *buf, size_t buf_len) { @@ -109,6 +154,53 @@ int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd, return ret; } +int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) +{ + u32 erase_size; + u8 cmd[4]; + int ret = -1; + + erase_size = flash->sector_size; + if (offset % erase_size || len % erase_size) { + debug("SF: Erase offset/length not multiple of erase size\n"); + return -1; + } + + if (erase_size == 4096) + cmd[0] = CMD_ERASE_4K; + else + cmd[0] = CMD_ERASE_64K; + + while (len) { +#ifdef CONFIG_SPI_FLASH_BAR + u8 bank_sel; + + bank_sel = offset / SPI_FLASH_16MB_BOUN; + + ret = spi_flash_cmd_bankaddr_write(flash, bank_sel); + if (ret) { + debug("SF: fail to set bank%d\n", bank_sel); + return ret; + } +#endif + spi_flash_addr(offset, cmd); + + debug("SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1], + cmd[2], cmd[3], offset); + + ret = spi_flash_write_common(flash, cmd, sizeof(cmd), NULL, 0); + if (ret < 0) { + debug("SF: erase failed\n"); + break; + } + + offset += erase_size; + len -= erase_size; + } + + return ret; +} + int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset, size_t len, const void *buf) { @@ -218,98 +310,6 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, return ret; } -int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) -{ - struct spi_slave *spi = flash->spi; - unsigned long timebase; - int ret; - u8 status; - u8 check_status = 0x0; - u8 poll_bit = STATUS_WIP; - u8 cmd = flash->poll_cmd; - - if (cmd == CMD_FLAG_STATUS) { - poll_bit = STATUS_PEC; - check_status = poll_bit; - } - - ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN); - if (ret) { - debug("SF: fail to read %s status register\n", - cmd == CMD_READ_STATUS ? "read" : "flag"); - return ret; - } - - timebase = get_timer(0); - do { - WATCHDOG_RESET(); - - ret = spi_xfer(spi, 8, NULL, &status, 0); - if (ret) - return -1; - - if ((status & poll_bit) == check_status) - break; - - } while (get_timer(timebase) < timeout); - - spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END); - - if ((status & poll_bit) == check_status) - return 0; - - /* Timed out */ - debug("SF: time out!\n"); - return -1; -} - -int spi_flash_cmd_erase(struct spi_flash *flash, u32 off
[U-Boot] [PATCH v2 3/4] sf: Add debug messages on spi_flash_read_common
- Added debug's on spi_flash_read_common() - Added space Signed-off-by: Jagannadha Sutradharudu Teki --- Changes for v2: - none drivers/mtd/spi/spi_flash.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 492a784..f53d001 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -254,8 +254,18 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, struct spi_slave *spi = flash->spi; int ret; - spi_claim_bus(spi); + ret = spi_claim_bus(flash->spi); + if (ret) { + debug("SF: Unable to claim SPI bus\n"); + return ret; + } + ret = spi_flash_cmd_read(spi, cmd, cmd_len, data, data_len); + if (ret < 0) { + debug("SF: read cmd failed\n"); + return ret; + } + spi_release_bus(spi); return ret; -- 1.8.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: mxs: Consolidate configuration options
Pull all the duplicate configuration options into configs/mxs.h from the board configuration files. This reduces the files greatly and makes them somewhat more readable. Besides, we do no longer have such a horrible duplication of code. Note that the mx23evk grew in size slightly. This is due to the CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of MXS systems. This patch also fixes the OCRAM size for i.MX23. The i.MX23 has only 32kB of OCRAM, while i.MX28 has 128kB of OCRAM. I verified the configuration didn't change for each of the boards, but I didn't boot-test it on the boards I do not have. I configured U-Boot for each board using the "make ... _config" command and then ran "cpp -I include -dM include/config.h" , which dumped all the configuration options. I did this both before and after this patch and finally compared the results for each MXS board. Actually, the results do differ slightly, since the configs/mxs.h file now properly includes the correct iomux-mx23.h or iomux-mx28.h , so while comparing, I had to ignore these new defines. These have no impact on U-Boot configuration though. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Lauri Hintsala Cc: Otavio Salvador Cc: Stefano Babic --- include/configs/apx4devkit.h | 120 include/configs/m28evk.h | 164 +--- include/configs/mx23_olinuxino.h | 138 +-- include/configs/mx23evk.h| 115 --- include/configs/mx28evk.h| 173 -- include/configs/mxs.h| 191 ++ include/configs/sc_sps_1.h | 139 --- 7 files changed, 332 insertions(+), 708 deletions(-) create mode 100644 include/configs/mxs.h diff --git a/include/configs/apx4devkit.h b/include/configs/apx4devkit.h index 3242133..7081f37 100644 --- a/include/configs/apx4devkit.h +++ b/include/configs/apx4devkit.h @@ -19,34 +19,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#ifndef __CONFIG_H -#define __CONFIG_H +#ifndef __CONFIGS_APX4DEVKIT_H__ +#define __CONFIGS_APX4DEVKIT_H__ -/* SoC configurations */ +/* System configurations */ #define CONFIG_MX28/* i.MX28 SoC */ -#define CONFIG_MXS_GPIO/* GPIO control */ -#define CONFIG_SYS_HZ 1000/* Ticks per second */ - #define MACH_TYPE_APX4DEVKIT 3712 #define CONFIG_MACH_TYPE MACH_TYPE_APX4DEVKIT -#include - -#define CONFIG_SYS_NO_FLASH -#define CONFIG_BOARD_EARLY_INIT_F -#define CONFIG_ARCH_CPU_INIT -#define CONFIG_ARCH_MISC_INIT - -/* SPL */ -#define CONFIG_SPL -#define CONFIG_SPL_NO_CPU_SUPPORT_CODE -#define CONFIG_SPL_START_S_PATH"arch/arm/cpu/arm926ejs/mxs" -#define CONFIG_SPL_LDSCRIPT"arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" -#define CONFIG_SPL_LIBCOMMON_SUPPORT -#define CONFIG_SPL_LIBGENERIC_SUPPORT -#define CONFIG_SPL_GPIO_SUPPORT - /* U-Boot Commands */ +#define CONFIG_SYS_NO_FLASH #include #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DOS_PARTITION @@ -66,78 +48,26 @@ #define CONFIG_CMD_SAVEENV #define CONFIG_CMD_USB -/* Memory configurations */ +/* Memory configuration */ #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ #define PHYS_SDRAM_1 0x4000 /* Base address */ #define PHYS_SDRAM_1_SIZE 0x2000 /* Max 512 MB RAM */ -#define CONFIG_SYS_MALLOC_LEN 0x0040 /* 4 MB for malloc */ -#define CONFIG_SYS_MEMTEST_START 0x4000 /* Memtest start adr */ -#define CONFIG_SYS_MEMTEST_END 0x4040 /* 4 MB RAM test */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -/* Point initial SP in SRAM so SPL can use it too. */ -#define CONFIG_SYS_INIT_RAM_ADDR 0x -#define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024) - -#define CONFIG_SYS_INIT_SP_OFFSET \ - (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) -#define CONFIG_SYS_INIT_SP_ADDR \ - (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) - -/* - * We need to sacrifice first 4 bytes of RAM here to avoid triggering some - * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot - * binary. In case there was more of this mess, 0x100 bytes are skipped. - */ -#define CONFIG_SYS_TEXT_BASE 0x4100 +/* Environment */ #define CONFIG_ENV_OVERWRITE - -/* U-Boot general configurations */ -#define CONFIG_SYS_LONGHELP -#define CONFIG_SYS_PROMPT "=> " -#define CONFIG_SYS_CBSIZE 1024/* Console I/O buffer size */ -#define CONFIG_SYS_PBSIZE \ - (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) - /* Print buffer size */ -#define CONFIG_SYS_MAXARGS 32 /* Max number of command ar
[U-Boot] [PATCH v2 1/4] sf: Unify spi_flash write code
Move common flash write code into spi_flash_write_common(). Signed-off-by: Jagannadha Sutradharudu Teki --- Changes for v2: - remove timeout arg in spi_flash_write_common drivers/mtd/spi/spi_flash.c | 122 --- drivers/mtd/spi/spi_flash_internal.h | 6 ++ 2 files changed, 60 insertions(+), 68 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index c439601..80d2fe6 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -68,22 +68,57 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len, return spi_flash_read_write(spi, cmd, cmd_len, data, NULL, data_len); } -int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset, - size_t len, const void *buf) +int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd, + size_t cmd_len, const void *buf, size_t buf_len) { - unsigned long byte_addr, page_size; - size_t chunk_len, actual; + struct spi_slave *spi = flash->spi; + unsigned long timeout = SPI_FLASH_PROG_TIMEOUT; int ret; - u8 cmd[4]; - page_size = flash->page_size; + if (buf == NULL) + timeout = SPI_FLASH_PAGE_ERASE_TIMEOUT; ret = spi_claim_bus(flash->spi); if (ret) { - debug("SF: unable to claim SPI bus\n"); + debug("SF: Unable to claim SPI bus\n"); return ret; } + ret = spi_flash_cmd_write_enable(flash); + if (ret < 0) { + debug("SF: enabling write failed\n"); + return ret; + } + + ret = spi_flash_cmd_write(spi, cmd, cmd_len, buf, buf_len); + if (ret < 0) { + debug("SF: write cmd failed\n"); + return ret; + } + + ret = spi_flash_cmd_wait_ready(flash, timeout); + if (ret < 0) { + debug("SF: write %s timed out\n", + timeout == SPI_FLASH_PROG_TIMEOUT ? + "program" : "page erase"); + return ret; + } + + spi_release_bus(spi); + + return ret; +} + +int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset, + size_t len, const void *buf) +{ + unsigned long byte_addr, page_size; + size_t chunk_len, actual; + u8 cmd[4]; + int ret = -1; + + page_size = flash->page_size; + cmd[0] = CMD_PAGE_PROGRAM; for (actual = 0; actual < len; actual += chunk_len) { #ifdef CONFIG_SPI_FLASH_BAR @@ -108,27 +143,16 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset, debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = %zu\n", buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len); - ret = spi_flash_cmd_write_enable(flash); - if (ret < 0) { - debug("SF: enabling write failed\n"); - break; - } - - ret = spi_flash_cmd_write(flash->spi, cmd, 4, - buf + actual, chunk_len); + ret = spi_flash_write_common(flash, cmd, sizeof(cmd), + buf + actual, chunk_len); if (ret < 0) { debug("SF: write failed\n"); break; } - ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT); - if (ret) - break; - offset += chunk_len; } - spi_release_bus(flash->spi); return ret; } @@ -242,8 +266,8 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) { u32 erase_size; - int ret; u8 cmd[4]; + int ret = -1; erase_size = flash->sector_size; if (offset % erase_size || len % erase_size) { @@ -251,12 +275,6 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) return -1; } - ret = spi_claim_bus(flash->spi); - if (ret) { - debug("SF: Unable to claim SPI bus\n"); - return ret; - } - if (erase_size == 4096) cmd[0] = CMD_ERASE_4K; else @@ -279,24 +297,16 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) debug("SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1], cmd[2], cmd[3], offset); - ret = spi_flash_cmd_write_enable(flash); - if (ret) - goto out; - - ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd), NULL, 0); - if (ret) - goto out; - - ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOU
[U-Boot] [PATCH v2 4/4] sf: Warn to use BAR for > 16MiB flashes
Warning for > 16MiB flashes to #define CONFIG_SPI_FLASH_BAR Signed-off-by: Jagannadha Sutradharudu Teki --- Changes for v2: - none drivers/mtd/spi/spi_flash.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index f53d001..7e34f6e 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -563,6 +563,12 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, if (flash->memory_map) printf(", mapped at %p", flash->memory_map); puts("\n"); +#ifndef CONFIG_SPI_FLASH_BAR + if (flash->size > SPI_FLASH_16MB_BOUN) { + puts("SF: Warning - Only lower 16MiB accessible,"); + puts(" Full access #define CONFIG_SPI_FLASH_BAR\n"); + } +#endif spi_release_bus(spi); -- 1.8.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114
Dear Jim Lin, > Add DT node for USB EHCI function. > Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards. I'd like to get ACK from someone with the actual hardware. btw. How usable is the cardhu with current U-Boot ? That's the ASUS TF700, right? How can I install U-Boot on it, is there any howto? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: mxs: Consolidate configuration options
Dear Marek, In message <1371316336-31711-1-git-send-email-ma...@denx.de> you wrote: > > Note that the mx23evk grew in size slightly. This is due to the > CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of > MXS systems. What is that needed for? 1024 bytes is more than 12 lines of 80 characters each - when do you ever need that much console input in a single line? 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 Just about every computer on the market today runs Unix, except the Mac (and nobody cares about it). - Bill Joy 6/21/85 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: mxs: Consolidate configuration options
Dear Wolfgang Denk, > Dear Marek, > > In message <1371316336-31711-1-git-send-email-ma...@denx.de> you wrote: > > Note that the mx23evk grew in size slightly. This is due to the > > CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of > > MXS systems. > > What is that needed for? 1024 bytes is more than 12 lines of 80 > characters each - when do you ever need that much console input in a > single line? Probably almost never, but since all the boards do use it, I'll keep it at that. I'd prefer to replace this with 256 in a subsequent patch, can we agree on that? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, am33xx: move s_init to a common place
> "Tom" == Tom Rini writes: Hi, >> BTW: >> I just realized that I have on one of the three boards a problem, >> that in spl code calling the rtc32k_enable() crashes ... which >> votes against moving this to a common place ... I haveno real idea >> why ... did you heard from such a behaviour? Is there some am335x >> soc, which differs from the others? Tom> You aren't using a different clock crystal rate than the reference Tom> platforms, are you? I know that's a problem that needs solving Tom> still. Really? We have a am335x based board using a 25MHz input clock, and I haven't noticed any problems. What are those problems exactly? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114
On Fri, Jun 14, 2013 at 06:41:40PM +0800, Jim Lin wrote: [...] > diff --git a/board/nvidia/dts/tegra30-beaver.dts > b/board/nvidia/dts/tegra30-beaver.dts [...] > @@ -68,4 +69,9 @@ > status = "okay"; > bus-width = <8>; > }; > + > + usb@7d008000 { > + nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */ This doesn't work for me on Beaver. I need to turn the above line into this: nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */ PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used. With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed something strange. When I try to use USB, I get this: Tegra30 (Beaver) # usb start (Re)start USB... USB0: set_host_mode: GPIO 236 high USB EHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however, the storage device is detected: Tegra30 (Beaver) # usb reset (Re)start USB... USB0: set_host_mode: GPIO 236 high USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found Any idea what might be going on here? Thierry pgpzHDBQS6jxd.pgp Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114
Dear Thierry Reding, > On Fri, Jun 14, 2013 at 06:41:40PM +0800, Jim Lin wrote: > [...] > > > diff --git a/board/nvidia/dts/tegra30-beaver.dts > > b/board/nvidia/dts/tegra30-beaver.dts > > [...] > > > @@ -68,4 +69,9 @@ > > > > status = "okay"; > > bus-width = <8>; > > > > }; > > > > + > > + usb@7d008000 { > > + nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */ > > This doesn't work for me on Beaver. I need to turn the above line into > this: > > nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */ > > PDD4 is the correct GPIO according to the schematics and the pin is > high-active. Also as far as I can tell, 3 is not a meaningful value for > the U-Boot GPIO bindings. Only the value 1 (low-active) is used. > > With that change applied on top of your patches I can see that a USB > flash drive connected to USB3 is indeed powered. However I noticed > something strange. When I try to use USB, I get this: > > Tegra30 (Beaver) # usb start > (Re)start USB... > USB0: set_host_mode: GPIO 236 high > USB EHCI 1.00 > scanning bus 0 for devices... 1 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > scanning usb for ethernet devices... 0 Ethernet Device(s) found > > So no storage device is detected, even though a USB flash drive is > connected and powered properly. If I repeat the same command, however, > the storage device is detected: > > Tegra30 (Beaver) # usb reset > (Re)start USB... > USB0: set_host_mode: GPIO 236 high > USB EHCI 1.00 > scanning bus 0 for devices... 2 USB Device(s) found > scanning usb for storage devices... 1 Storage Device(s) found > scanning usb for ethernet devices... 0 Ethernet Device(s) found > > Any idea what might be going on here? Try waiting a little after setting the GPIO maybe? The drive might need some time to settle. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: mxs: Make the console buffer smaller
Using 1024 bytes for console buffer is unnecessarily too much, lower the amount for all MXS boards to 256. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Lauri Hintsala Cc: Otavio Salvador Cc: Stefano Babic --- include/configs/mxs.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Note: This depends on http://patchwork.ozlabs.org/patch/251631/ diff --git a/include/configs/mxs.h b/include/configs/mxs.h index a684166..161d89d 100644 --- a/include/configs/mxs.h +++ b/include/configs/mxs.h @@ -92,7 +92,7 @@ #ifndef CONFIG_SYS_PROMPT #define CONFIG_SYS_PROMPT "=> " #endif -#define CONFIG_SYS_CBSIZE 1024/* Console I/O buffer size */ +#define CONFIG_SYS_CBSIZE 256 /* Console I/O buffer size */ #define CONFIG_SYS_PBSIZE \ (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) /* Print buffer size */ -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: mxs: Consolidate configuration options
Hello Wolfgang, > Dear Wolfgang Denk, > > > Dear Marek, > > > > In message <1371316336-31711-1-git-send-email-ma...@denx.de> you wrote: > > > Note that the mx23evk grew in size slightly. This is due to the > > > CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of > > > MXS systems. > > > > What is that needed for? 1024 bytes is more than 12 lines of 80 > > characters each - when do you ever need that much console input in a > > single line? > > Probably almost never, but since all the boards do use it, I'll keep it at > that. I'd prefer to replace this with 256 in a subsequent patch, can we > agree on that? Subsequent patch is out of the doors, thanks for pointing this out. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] dwc_ahsata: Allow use with dcache enabled
Signed-off-by: Eric Nelson --- drivers/block/dwc_ahsata.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c index c9b71f7..98f2c52 100644 --- a/drivers/block/dwc_ahsata.c +++ b/drivers/block/dwc_ahsata.c @@ -447,10 +447,13 @@ static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent, if (buf && buf_len) sg_count = ahci_fill_sg(probe_ent, port, buf, buf_len); opts = (sizeof(struct sata_fis_h2d) >> 2) | (sg_count << 16); - if (is_write) + if (is_write) { opts |= 0x40; + flush_cache((ulong)buf, buf_len); + } ahci_fill_cmd_slot(pp, cmd_slot, opts); + flush_cache((int)(pp->cmd_slot), AHCI_PORT_PRIV_DMA_SZ); writel_with_flush(1 << cmd_slot, &(port_mmio->ci)); if (waiting_for_cmd_completed((u8 *)&(port_mmio->ci), @@ -458,8 +461,12 @@ static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent, printf("timeout exit!\n"); return -1; } + invalidate_dcache_range((int)(pp->cmd_slot), + (int)(pp->cmd_slot)+AHCI_PORT_PRIV_DMA_SZ); debug("ahci_exec_ata_cmd: %d byte transferred.\n", pp->cmd_slot->status); + if (!is_write) + invalidate_dcache_range((ulong)buf, (ulong)buf+buf_len); return buf_len; } @@ -468,7 +475,8 @@ static void ahci_set_feature(u8 dev, u8 port) { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; memset(cfis, 0, sizeof(struct sata_fis_h2d)); cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; @@ -615,7 +623,8 @@ static void dwc_ahsata_identify(int dev, u16 *id) { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; memset(cfis, 0, sizeof(struct sata_fis_h2d)); @@ -645,7 +654,8 @@ static u32 dwc_ahsata_rw_cmd(int dev, u32 start, u32 blkcnt, { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; u32 block; @@ -675,7 +685,8 @@ void dwc_ahsata_flush_cache(int dev) { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; memset(cfis, 0, sizeof(struct sata_fis_h2d)); @@ -692,7 +703,8 @@ static u32 dwc_ahsata_rw_cmd_ext(int dev, u32 start, lbaint_t blkcnt, { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; u64 block; @@ -728,7 +740,8 @@ u32 dwc_ahsata_rw_ncq_cmd(int dev, u32 start, lbaint_t blkcnt, { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; u64 block; @@ -769,7 +782,8 @@ void dwc_ahsata_flush_cache_ext(int dev) { struct ahci_probe_ent *probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; - struct sata_fis_h2d h2d, *cfis = &h2d; + struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN); + struct sata_fis_h2d *cfis = &h2d; u8 port = probe_ent->hard_port_no; memset(cfis, 0, sizeof(struct sata_fis_h2d)); @@ -912,7 +926,9 @@ int scan_sata(int dev) u8 port = probe_ent->hard_port_no; block_dev_desc_t *pdev = &(sata_dev_desc[dev]); - id = (u16 *)malloc(ATA_ID_WORDS * 2); + id = (u16 *)memalign(ARCH_DMA_MINALIGN, + roundup(ARCH_DMA_MINALIGN, + (ATA_ID_WORDS * 2))); if (!id) { printf("id malloc failed\n\r"); return -1; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/li
Re: [U-Boot] Please pull u-boot-mmc.git
On Fri, Jun 14, 2013 at 02:34:46PM -0500, Andy Fleming wrote: > The following changes since commit 077becc345717c3cf32e88316298b74d0cff6581: > > Merge branch 'master' of git://git.denx.de/u-boot-74xx-7xx (2013-06-11 > 18:11:47 -0400) > > are available in the git repository at: > > > git://www.denx.de/git/u-boot-mmc.git master > > for you to fetch changes up to 91171091c6733cd290e18bf25a8aedbe682d2430: > > ARM: tegra: make use of negative ENV_OFFSET on NVIDIA boards (2013-06-13 > 16:52:20 -0500) > > > Andrew Gabbasov (1): > fsl_esdhc: Do not clear interrupt status bits until data processed > > Bo Shen (1): > mmc: fix env in mmc with redundant compile error > > Fabio Estevam (1): > mmc: fsl_esdhc: Fix hang after 'save' command > > Jagannadha Sutradharudu Teki (1): > mmc: sdhci: Enable 8-bit bus width only for 3.0 spec onwards > > Ruud Commandeur (1): > mmc write bug fix > > Stephen Warren (4): > README: document CONFIG_ENV_IS_IN_MMC > mmc: report capacity for the selected partition > env_mmc: allow negative CONFIG_ENV_OFFSET > ARM: tegra: make use of negative ENV_OFFSET on NVIDIA boards > > README | 51 + > common/env_mmc.c | 12 +-- > drivers/mmc/fsl_esdhc.c|9 +++--- > drivers/mmc/mmc.c | 76 > ++-- > drivers/mmc/sdhci.c|6 ++-- > include/configs/beaver.h |2 +- > include/configs/cardhu.h |2 +- > include/configs/dalmore.h |2 +- > include/configs/paz00.h|2 +- > include/configs/seaboard.h |2 +- > include/configs/ventana.h |2 +- > include/configs/whistler.h |4 +-- > include/environment.h |6 > include/mmc.h |7 > 14 files changed, 156 insertions(+), 27 deletions(-) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot