public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file
@ 2020-10-31 16:32 Pali Rohár
  2020-10-31 16:32 ` [PATCH 2/6] Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock() Pali Rohár
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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)
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock()
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
@ 2020-10-31 16:32 ` Pali Rohár
  2020-10-31 16:32 ` [PATCH 3/6] Nokia RX-51: During init disable lp5523 led instead of resetting it Pali Rohár
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] Nokia RX-51: During init disable lp5523 led instead of resetting it
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
  2020-10-31 16:32 ` [PATCH 2/6] Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock() Pali Rohár
@ 2020-10-31 16:32 ` Pali Rohár
  2020-10-31 16:32 ` [PATCH 4/6] Nokia RX-51: Update test script Pali Rohár
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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();
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] Nokia RX-51: Update test script
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
  2020-10-31 16:32 ` [PATCH 2/6] Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock() Pali Rohár
  2020-10-31 16:32 ` [PATCH 3/6] Nokia RX-51: During init disable lp5523 led instead of resetting it Pali Rohár
@ 2020-10-31 16:32 ` Pali Rohár
  2020-10-31 16:32 ` [PATCH 5/6] Nokia RX-51: Make onenand working Pali Rohár
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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 "============================="
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] Nokia RX-51: Make onenand working
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
                   ` (2 preceding siblings ...)
  2020-10-31 16:32 ` [PATCH 4/6] Nokia RX-51: Update test script Pali Rohár
@ 2020-10-31 16:32 ` Pali Rohár
  2020-10-31 16:32 ` [PATCH 6/6] mtd: OneNAND: Set MTD type Pali Rohár
  2020-11-15 10:05 ` [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Lokesh Vutla
  5 siblings, 0 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] mtd: OneNAND: Set MTD type
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
                   ` (3 preceding siblings ...)
  2020-10-31 16:32 ` [PATCH 5/6] Nokia RX-51: Make onenand working Pali Rohár
@ 2020-10-31 16:32 ` Pali Rohár
  2020-11-15 10:05 ` [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Lokesh Vutla
  5 siblings, 0 replies; 9+ messages in thread
From: Pali Rohár @ 2020-10-31 16:32 UTC (permalink / raw)
  To: u-boot

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;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file
  2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
                   ` (4 preceding siblings ...)
  2020-10-31 16:32 ` [PATCH 6/6] mtd: OneNAND: Set MTD type Pali Rohár
@ 2020-11-15 10:05 ` Lokesh Vutla
  2020-11-15 12:06   ` Pali Rohár
  5 siblings, 1 reply; 9+ messages in thread
From: Lokesh Vutla @ 2020-11-15 10:05 UTC (permalink / raw)
  To: u-boot



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file
  2020-11-15 10:05 ` [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Lokesh Vutla
@ 2020-11-15 12:06   ` Pali Rohár
  2020-11-16  3:27     ` Lokesh Vutla
  0 siblings, 1 reply; 9+ messages in thread
From: Pali Rohár @ 2020-11-15 12:06 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file
  2020-11-15 12:06   ` Pali Rohár
@ 2020-11-16  3:27     ` Lokesh Vutla
  0 siblings, 0 replies; 9+ messages in thread
From: Lokesh Vutla @ 2020-11-16  3:27 UTC (permalink / raw)
  To: u-boot



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-16  3:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-31 16:32 [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Pali Rohár
2020-10-31 16:32 ` [PATCH 2/6] Nokia RX-51: Fix crashing in U-Boot mmc function omap_hsmmc_stop_clock() Pali Rohár
2020-10-31 16:32 ` [PATCH 3/6] Nokia RX-51: During init disable lp5523 led instead of resetting it Pali Rohár
2020-10-31 16:32 ` [PATCH 4/6] Nokia RX-51: Update test script Pali Rohár
2020-10-31 16:32 ` [PATCH 5/6] Nokia RX-51: Make onenand working Pali Rohár
2020-10-31 16:32 ` [PATCH 6/6] mtd: OneNAND: Set MTD type Pali Rohár
2020-11-15 10:05 ` [PATCH 1/6] Nokia RX-51: Remove old comments from configs/nokia_rx51.h file Lokesh Vutla
2020-11-15 12:06   ` Pali Rohár
2020-11-16  3:27     ` Lokesh Vutla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox