[PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file

These comments are relict for old, now removed config options. So remove these obsoleted comments too.
Signed-off-by: Pali Rohár pali@kernel.org --- include/configs/nokia_rx51.h | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 9b89120342..6879f52a0c 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -75,12 +75,6 @@ #define CONFIG_USBD_MANUFACTURER "Nokia" #define CONFIG_USBD_PRODUCT_NAME "N900"
-/* commands to include */ - -/* - * TWL4030 - */ - #define GPIO_SLIDE 71
/* @@ -229,10 +223,6 @@ int rx51_kp_getc(struct stdio_dev *sdev); "run attachboot;" \ "echo"
-/* - * Miscellaneous configurable options - */ - /* default load address */ #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)

After commit 04a2ea248f58 ("mmc: disable UHS modes if Vcc cannot be switched on and off") U-Boot started crashing on Nokia RX-51 while initializing mmc and caused reboot loop.
It looks like that some clocks were not enabled and this patch fixes U-Boot mmc crash.
Signed-off-by: Pali Rohár pali@kernel.org Cc: Ivaylo Dimitrov ivo.g.dimitrov.75@gmail.com --- board/nokia/rx51/rx51.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 63531e1420..e11c527226 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -202,6 +202,8 @@ int board_init(void) { /* in SRAM or SDRAM, finish GPMC */ gpmc_init(); + /* Enable the clks & power */ + per_clocks_enable(); /* boot param addr */ gd->bd->bi_boot_params = OMAP34XX_SDRC_CS0 + 0x100; return 0;

After commit d5243359e1af ("OMAP24xx I2C: Add support for set-speed") U-Boot is unstable to reset lp5523 led. That commit added pooling for i2c poll ARDY bit which apparently is never set. It is not known what is happening here.
Purpose of resetting lp5523 led in Nokia RX-51 code is just to turn off very bright led which is powered on by NOLO and expects next boot image (kernel or U-Boot) to turn it off.
After testing we observed that just disabling lp5523 led is working fine.
So as a workaround to this ARDY bit i2c issue we disable lp5523 led instead of resetting it.
Signed-off-by: Pali Rohár pali@kernel.org Cc: Ivaylo Dimitrov ivo.g.dimitrov.75@gmail.com --- board/nokia/rx51/rx51.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index e11c527226..528c592441 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -394,9 +394,9 @@ int misc_init_r(void) char buf[12]; u8 state;
- /* reset lp5523 led */ + /* disable lp5523 led */ if (i2c_get_chip_for_busnum(1, 0x32, 1, &dev) == 0) - dm_i2c_reg_write(dev, 0x3d, 0xff); + dm_i2c_reg_write(dev, 0x00, 0x00);
/* initialize twl4030 power managment */ twl4030_power_init();

Include emmc/nand suffix into bootmenu script names and fix leaking sleep processes when asynchronously waiting for them. 'wait -n' is not provided by /bin/sh, so run script under bash.
Signed-off-by: Pali Rohár pali@kernel.org --- test/nokia_rx51_test.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/test/nokia_rx51_test.sh b/test/nokia_rx51_test.sh index b17542b8c1..23fa935310 100755 --- a/test/nokia_rx51_test.sh +++ b/test/nokia_rx51_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e # SPDX-License-Identifier: GPL-2.0+ # (C) 2020 Pali Rohár pali@kernel.org
@@ -157,7 +157,7 @@ setenv bootmenu_1; setenv bootmenu_delay 1; setenv bootdelay 1; EOF -./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu -d bootmenu_emmc bootmenu_emmc.scr +./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_emmc -d bootmenu_emmc bootmenu_emmc.scr
# Generate bootmenu for OneNAND booting cat > bootmenu_nand << EOF @@ -166,7 +166,7 @@ setenv bootmenu_1; setenv bootmenu_delay 1; setenv bootdelay 1; EOF -./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu -d bootmenu_nand bootmenu_nand.scr +./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_nand -d bootmenu_nand bootmenu_nand.scr
# Generate combined image from u-boot and Maemo fiasco kernel dd if=kernel_2.6.28/boot/zImage-2.6.28-20103103+0m5.fiasco of=zImage-2.6.28-omap1 skip=95 bs=1 @@ -214,10 +214,11 @@ rm -f qemu_ram.log qemu_pid=$! tail -F qemu_ram.log & tail_pid=$! -{ sleep 300 || true; kill -9 $qemu_pid $tail_pid 2>/dev/null || true; } & +sleep 300 & sleep_pid=$! -wait $qemu_pid || true -kill -9 $tail_pid $sleep_pid 2>/dev/null || true +wait -n $sleep_pid $qemu_pid || true +kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true +wait || true
# Run MTD image in qemu and wait for 300s if kernel from eMMC is correctly booted rm -f qemu_emmc.log @@ -225,10 +226,11 @@ rm -f qemu_emmc.log qemu_pid=$! tail -F qemu_emmc.log & tail_pid=$! -{ sleep 300 || true; kill -9 $qemu_pid $tail_pid 2>/dev/null || true; } & +sleep 300 & sleep_pid=$! -wait $qemu_pid || true -kill -9 $tail_pid $sleep_pid 2>/dev/null || true +wait -n $sleep_pid $qemu_pid || true +kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true +wait || true
# Run MTD image in qemu and wait for 300s if kernel from OneNAND is correctly booted rm -f qemu_nand.log @@ -236,10 +238,11 @@ rm -f qemu_nand.log qemu_pid=$! tail -F qemu_nand.log & tail_pid=$! -{ sleep 300 || true; kill -9 $qemu_pid $tail_pid 2>/dev/null || true; } & +sleep 300 & sleep_pid=$! -wait $qemu_pid || true -kill -9 $tail_pid $sleep_pid 2>/dev/null || true +wait -n $sleep_pid $qemu_pid || true +kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true +wait || true
echo echo "============================="

From: Ivaylo Dimitrov ivo.g.dimitrov.75@gmail.com
set_gpmc_cs0() sets wrong timings and size for Nokia N900 onenand flash. Fix that by setting the correct timings and size from the board code
Signed-off-by: Ivaylo Dimitrov ivo.g.dimitrov.75@gmail.com Tested-by: Pali Rohár pali@kernel.org --- board/nokia/rx51/rx51.c | 15 +++++++++++++++ board/nokia/rx51/rx51.h | 7 +++++++ 2 files changed, 22 insertions(+)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 528c592441..3d62b5d9ad 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -200,8 +200,23 @@ static void reuse_atags(void) */ int board_init(void) { +#if defined(CONFIG_CMD_ONENAND) + const u32 gpmc_regs_onenandrx51[GPMC_MAX_REG] = { + ONENAND_GPMC_CONFIG1_RX51, + ONENAND_GPMC_CONFIG2_RX51, + ONENAND_GPMC_CONFIG3_RX51, + ONENAND_GPMC_CONFIG4_RX51, + ONENAND_GPMC_CONFIG5_RX51, + ONENAND_GPMC_CONFIG6_RX51, + 0 + }; +#endif /* in SRAM or SDRAM, finish GPMC */ gpmc_init(); +#if defined(CONFIG_CMD_ONENAND) + enable_gpmc_cs_config(gpmc_regs_onenandrx51, &gpmc_cfg->cs[0], + CONFIG_SYS_ONENAND_BASE, GPMC_SIZE_256M); +#endif /* Enable the clks & power */ per_clocks_enable(); /* boot param addr */ diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h index fa1b42bf21..4eff823a1b 100644 --- a/board/nokia/rx51/rx51.h +++ b/board/nokia/rx51/rx51.h @@ -367,4 +367,11 @@ struct emu_hal_params_rx51 { MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/
+#define ONENAND_GPMC_CONFIG1_RX51 0xfb001202 +#define ONENAND_GPMC_CONFIG2_RX51 0x00111100 +#define ONENAND_GPMC_CONFIG3_RX51 0x00020200 +#define ONENAND_GPMC_CONFIG4_RX51 0x11001102 +#define ONENAND_GPMC_CONFIG5_RX51 0x03101616 +#define ONENAND_GPMC_CONFIG6_RX51 0x90060000 + #endif

onenand_probe() function is missing to set mtd->type. So set same type as which sets onenand Linux kernel driver.
After this change 'mtd list' prints correct type instead of 'Unknown'.
Signed-off-by: Pali Rohár pali@kernel.org --- drivers/mtd/onenand/onenand_base.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 36daef01ae..09daa0dd36 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -2657,6 +2657,7 @@ int onenand_probe(struct mtd_info *mtd) else mtd->size = this->chipsize;
+ mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH; mtd->flags = MTD_CAP_NANDFLASH; mtd->_erase = onenand_erase; mtd->_read_oob = onenand_read_oob;

On 31/10/20 10:02 pm, Pali Rohár wrote:
These comments are relict for old, now removed config options. So remove these obsoleted comments too.
Signed-off-by: Pali Rohár pali@kernel.org
Series applied to u-boot-ti for-next branch. Next time please write a cover letter.
Thanks and regards, Lokesh

On Sunday 15 November 2020 15:35:37 Lokesh Vutla wrote:
Series applied to u-boot-ti for-next branch.
It is possible to include this patch series into v2021.01 version? Because currently in u-boot master branch is N900 non-working and these patches (as stated in commit messages) are fixing it.
Next time please write a cover letter.
Ok, Next time I will do it.

On 15/11/20 5:36 pm, Pali Rohár wrote:
On Sunday 15 November 2020 15:35:37 Lokesh Vutla wrote:
Series applied to u-boot-ti for-next branch.
It is possible to include this patch series into v2021.01 version? Because currently in u-boot master branch is N900 non-working and these patches (as stated in commit messages) are fixing it.
You are right. Ill send a PR to Tom for rc.
Thanks and regards, Lokesh
Next time please write a cover letter.
Ok, Next time I will do it.
participants (2)
-
Lokesh Vutla
-
Pali Rohár