Skip to contentSkip to conversation

Nokia RX-51: Remove old comments from configs/nokia_rx51.h file

PATCH New Pali Rohár 2 participants 9 messages Oct 31, 2020 – Nov 16, 2020 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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.

---
 include/configs/nokia_rx51.h | 10 ----------
 1 file changed, 10 deletions(-)
include/configs/nokia_rx51.h +0 -10
index 9b89120342..6879f52a0c 100644
@@ -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)
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/6 Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock()

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.

Cc Ivaylo Dimitrov <[email protected]>
---
 board/nokia/rx51/rx51.c | 2 ++
 1 file changed, 2 insertions(+)
board/nokia/rx51/rx51.c +2 -0
index 63531e1420..e11c527226 100644
@@ -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;
Signature · 1 line
2.20.1
#2 lore raw

PATCH 3/6 Nokia RX-51: During init disable lp5523 led instead of resetting it

In reply to Pali Rohár

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.

Cc Ivaylo Dimitrov <[email protected]>
---
 board/nokia/rx51/rx51.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/nokia/rx51/rx51.c +2 -2
index e11c527226..528c592441 100644
@@ -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();
Signature · 1 line
2.20.1
#3 lore raw

PATCH 4/6 Nokia RX-51: Update test script

In reply to Pali Rohár

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.

---
 test/nokia_rx51_test.sh | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)
test/nokia_rx51_test.sh +15 -12
index b17542b8c1..23fa935310 100755
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 # SPDX-License-Identifier: GPL-2.0+
 # (C) 2020 Pali Roh?r <[email protected]>
 
@@ -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 "============================="
Signature · 1 line
2.20.1
#4 lore raw

PATCH 5/6 Nokia RX-51: Make onenand working

In reply to Pali Rohár

From: Ivaylo Dimitrov <[email protected]>

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

---
 board/nokia/rx51/rx51.c | 15 +++++++++++++++
 board/nokia/rx51/rx51.h |  7 +++++++
 2 files changed, 22 insertions(+)
board/nokia/rx51/rx51.c +15 -0
index 528c592441..3d62b5d9ad 100644
@@ -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 */
board/nokia/rx51/rx51.h +7 -0
index fa1b42bf21..4eff823a1b 100644
@@ -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
Signature · 1 line
2.20.1
#5 lore raw

PATCH 6/6 mtd: OneNAND: Set MTD type

In reply to Pali Rohár

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'.

---
 drivers/mtd/onenand/onenand_base.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/onenand/onenand_base.c +1 -0
index 36daef01ae..09daa0dd36 100644
@@ -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;
Signature · 1 line
2.20.1
#6 lore raw

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

In reply to Pali Rohár
Quoted 4 lines · Pali Roh?r

These comments are relict for old, now removed config options. So remove these obsoleted comments too.

Series applied to u-boot-ti for-next branch. Next time please write a cover letter.

Thanks and regards,
Lokesh

#7 lore raw

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

Quoted 1 line · 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.

Quoted 1 line

Next time please write a cover letter.

Ok, Next time I will do it.

#8 lore raw

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

Quoted 6 lines · Pali Roh?r
Quoted 1 line · 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

Quoted 5 lines
Quoted 2 lines

Next time please write a cover letter.

Ok, Next time I will do it.