All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: ep93xx: various updates
@ 2017-02-21 18:15 H Hartley Sweeten
  2017-02-21 18:15 ` [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM H Hartley Sweeten
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: H Hartley Sweeten @ 2017-02-21 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

Here are a couple mach-ep93xx patches that I have been holding on to.
Some of these have been previously posted.

The first patch is needed for 128 MiB version of the TS-7300 board.
That board uses multiple chip selects for the SDRAM and does not boot
with the previous flatmem setup. With the switch, all the other ep93xx
boards I have still work properly.

The second patch has been rebased due to the chip select change in
the spi-ep93xx driver which has been merged.

Patch 3 is just a cosmetic change.

Patch 4 was originally from Florian Fainelli's github ts72xx branch.
It has been updated to the new spi-ep93xx chip select method.

H Hartley Sweeten (4):
  ARM: ep93xx: switch to SPARSEMEM
  ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
  ARM: ep93xx: tidy up TS-72xx Watchdog resources
  ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards

 arch/arm/Kconfig              |  2 +-
 arch/arm/mach-ep93xx/simone.c | 54 +++----------------------------------------
 arch/arm/mach-ep93xx/ts72xx.c | 47 +++++++++++++++++++++++++++----------
 arch/arm/mach-ep93xx/ts72xx.h |  3 ---
 4 files changed, 39 insertions(+), 67 deletions(-)

-- 
2.10.0

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
@ 2017-02-21 18:15 ` H Hartley Sweeten
  2017-05-13 18:21   ` Florian Fainelli
  2017-02-21 18:15 ` [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect H Hartley Sweeten
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: H Hartley Sweeten @ 2017-02-21 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

The EP93xx has four chip selects that can be used for the SDRAM memory.
These chip selects are decoded to specify an address domain:

  SDCS3  0x00000000-0x0fffffff with Boot Option ASDO=1
  SDCS0  0xc0000000-0xcfffffff
  SDCS1  0xd0000000-0xdfffffff
  SDCS2  0xe0000000-x0efffffff
  SDCS3  0xf0000000-0xffffffff with Boot Option ASDO=0

Because of the row/column/bank architecture of SDRAM, the mapping of
these memories into the processor's memory space is discontiguous.

Most ep93xx systems only use one of the chip selects. For these systems,
ARCH_HAS_HOLES_MEMORYMODEL has worked fine to handle the discontiguous
memory.

But, some of the TS-72xx boards use multiple chip selects. The TS-7300 in
particular uses SDCS3 (with ASDO=1) and SDCS2. On that system with
ARCH_HAS_HOLES_MEMORYMODEL the SDCS2 memory does not get handled correctly
and results in the system not booting.

Change the EP93xx to ARCH_SPARSEMEM_ENABLE. This handles the discontiguous
memory for all configurations.

This has been tested on the following ep93xx platforms:

EDB9307A with 64 MiB on SDCS0
Vision EP9307 with 64 MiB on SDCS0
TS-7300 with 64 MiB on SDCS3 (with ASDO=1) and 64 MiB on SDCS2
sim.one with 64 MiB on SDCS0

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>
---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 71cea9e..cc8a88f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -383,7 +383,7 @@ config ARCH_EBSA110
 
 config ARCH_EP93XX
 	bool "EP93xx-based"
-	select ARCH_HAS_HOLES_MEMORYMODEL
+	select ARCH_SPARSEMEM_ENABLE
 	select ARM_AMBA
 	select ARM_PATCH_PHYS_VIRT
 	select ARM_VIC
-- 
2.10.0

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

* [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
  2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
  2017-02-21 18:15 ` [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM H Hartley Sweeten
@ 2017-02-21 18:15 ` H Hartley Sweeten
  2017-05-13 18:26   ` Florian Fainelli
  2017-02-21 18:15 ` [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources H Hartley Sweeten
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: H Hartley Sweeten @ 2017-02-21 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

This board uses a GPIO for the MMC card detect. Let the mmc_spi
driver handle it instead of the platform code.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ep93xx/simone.c | 54 +++----------------------------------------
 1 file changed, 3 insertions(+), 51 deletions(-)

diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index c7a40f2..1c35386 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -43,60 +43,12 @@ static struct ep93xxfb_mach_info __initdata simone_fb_info = {
 	.flags		= EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
 };
 
-/*
- * GPIO lines used for MMC card detection.
- */
-#define MMC_CARD_DETECT_GPIO EP93XX_GPIO_LINE_EGPIO0
-
-/*
- * MMC card detection GPIO setup.
- */
-
-static int simone_mmc_spi_init(struct device *dev,
-	irqreturn_t (*irq_handler)(int, void *), void *mmc)
-{
-	unsigned int gpio = MMC_CARD_DETECT_GPIO;
-	int irq, err;
-
-	err = gpio_request(gpio, dev_name(dev));
-	if (err)
-		return err;
-
-	err = gpio_direction_input(gpio);
-	if (err)
-		goto fail;
-
-	irq = gpio_to_irq(gpio);
-	if (irq < 0)
-		goto fail;
-
-	err = request_irq(irq, irq_handler, IRQF_TRIGGER_FALLING,
-			  "MMC card detect", mmc);
-	if (err)
-		goto fail;
-
-	printk(KERN_INFO "%s: using irq %d for MMC card detection\n",
-	       dev_name(dev), irq);
-
-	return 0;
-fail:
-	gpio_free(gpio);
-	return err;
-}
-
-static void simone_mmc_spi_exit(struct device *dev, void *mmc)
-{
-	unsigned int gpio = MMC_CARD_DETECT_GPIO;
-
-	free_irq(gpio_to_irq(gpio), mmc);
-	gpio_free(gpio);
-}
-
 static struct mmc_spi_platform_data simone_mmc_spi_data = {
-	.init		= simone_mmc_spi_init,
-	.exit		= simone_mmc_spi_exit,
 	.detect_delay	= 500,
 	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.flags		= MMC_SPI_USE_CD_GPIO,
+	.cd_gpio	= EP93XX_GPIO_LINE_EGPIO0,
+	.cd_debounce	= 1,
 };
 
 static struct spi_board_info simone_spi_devices[] __initdata = {
-- 
2.10.0

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

* [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources
  2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
  2017-02-21 18:15 ` [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM H Hartley Sweeten
  2017-02-21 18:15 ` [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect H Hartley Sweeten
@ 2017-02-21 18:15 ` H Hartley Sweeten
  2017-05-13 18:26   ` Florian Fainelli
  2017-02-21 18:15 ` [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards H Hartley Sweeten
  2017-05-13 19:53 ` [PATCH 0/4] ARM: ep93xx: various updates Florian Fainelli
  4 siblings, 1 reply; 15+ messages in thread
From: H Hartley Sweeten @ 2017-02-21 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

The ts-72xx watchdog uses two byte sized registers. Tidy up the resource
declaration so that the proper information is shown in /proc/iomem.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 +++++++++-----------
 arch/arm/mach-ep93xx/ts72xx.h |  3 ---
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8a5b6f0..9b62e5c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -186,24 +186,22 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
+/*************************************************************************
+ * Watchdog (in CPLD)
+ *************************************************************************/
+#define TS72XX_WDT_CONTROL_PHYS_BASE	(EP93XX_CS2_PHYS_BASE + 0x03800000)
+#define TS72XX_WDT_FEED_PHYS_BASE	(EP93XX_CS2_PHYS_BASE + 0x03c00000)
+
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, 0x01),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, 0x01),
 };
 
 static struct platform_device ts72xx_wdt_device = {
 	.name		= "ts72xx-wdt",
 	.id		= -1,
-	.num_resources 	= ARRAY_SIZE(ts72xx_wdt_resources),
 	.resource	= ts72xx_wdt_resources,
+	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
 };
 
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 2255ba2..4e6519b 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -38,9 +38,6 @@
 #define TS72XX_OPTIONS2_TS9420		0x04
 #define TS72XX_OPTIONS2_TS9420_BOOT	0x02
 
-#define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
-#define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
-
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
-- 
2.10.0

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

* [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards
  2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
                   ` (2 preceding siblings ...)
  2017-02-21 18:15 ` [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources H Hartley Sweeten
@ 2017-02-21 18:15 ` H Hartley Sweeten
  2017-05-13 18:54   ` Florian Fainelli
  2017-05-13 19:53 ` [PATCH 0/4] ARM: ep93xx: various updates Florian Fainelli
  4 siblings, 1 reply; 15+ messages in thread
From: H Hartley Sweeten @ 2017-02-21 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

Register the TI TMP122 (lm70) temperature sensor driver for the TS-72xx
boards.

Originaly from Florian Fainelli. Updated to the new spi-ep93xx chip select
method.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/mach-ep93xx/ts72xx.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 9b62e5c..ec8272b 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,7 +18,10 @@
 #include <linux/io.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/platform_data/spi-ep93xx.h>
 
+#include <mach/gpio-ep93xx.h>
 #include <mach/hardware.h>
 
 #include <asm/mach-types.h>
@@ -208,14 +211,36 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * SPI Bus
+ *************************************************************************/
+static struct spi_board_info ts72xx_spi_devices[] __initdata = {
+	{
+		.modalias		= "tmp122",
+		.max_speed_hz		= 2 * 1000 * 1000,
+		.bus_num		= 0,
+		.chip_select		= 0,
+	},
+};
+
+static int ts72xx_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(2),		/* DIO_17 */
+};
+
+static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
+	.chipselect	= ts72xx_spi_chipselects,
+	.num_chipselect	= ARRAY_SIZE(ts72xx_spi_chipselects),
+};
+
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
 	ts72xx_register_flash();
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
-
 	ep93xx_register_eth(&ts72xx_eth_data, 1);
+	ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices,
+			    ARRAY_SIZE(ts72xx_spi_devices));
 }
 
 MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
-- 
2.10.0

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-02-21 18:15 ` [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM H Hartley Sweeten
@ 2017-05-13 18:21   ` Florian Fainelli
  2017-05-26 16:13     ` Florian Fainelli
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Fainelli @ 2017-05-13 18:21 UTC (permalink / raw)
  To: linux-arm-kernel

Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
> The EP93xx has four chip selects that can be used for the SDRAM memory.
> These chip selects are decoded to specify an address domain:
> 
>   SDCS3  0x00000000-0x0fffffff with Boot Option ASDO=1
>   SDCS0  0xc0000000-0xcfffffff
>   SDCS1  0xd0000000-0xdfffffff
>   SDCS2  0xe0000000-x0efffffff
>   SDCS3  0xf0000000-0xffffffff with Boot Option ASDO=0
> 
> Because of the row/column/bank architecture of SDRAM, the mapping of
> these memories into the processor's memory space is discontiguous.
> 
> Most ep93xx systems only use one of the chip selects. For these systems,
> ARCH_HAS_HOLES_MEMORYMODEL has worked fine to handle the discontiguous
> memory.
> 
> But, some of the TS-72xx boards use multiple chip selects. The TS-7300 in
> particular uses SDCS3 (with ASDO=1) and SDCS2. On that system with
> ARCH_HAS_HOLES_MEMORYMODEL the SDCS2 memory does not get handled correctly
> and results in the system not booting.
> 
> Change the EP93xx to ARCH_SPARSEMEM_ENABLE. This handles the discontiguous
> memory for all configurations.
> 
> This has been tested on the following ep93xx platforms:
> 
> EDB9307A with 64 MiB on SDCS0
> Vision EP9307 with 64 MiB on SDCS0
> TS-7300 with 64 MiB on SDCS3 (with ASDO=1) and 64 MiB on SDCS2
> sim.one with 64 MiB on SDCS0
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Tested-by: Linus Walleij <linus.walleij@linaro.org>
> Cc: Russell King <linux@armlinux.org.uk>

Tested-by: Florian Fainelli <f.fainelli@gmail.com>

On a TS-3700 with 32MiB of SDRAM, thanks!
-- 
Florian

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

* [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
  2017-02-21 18:15 ` [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect H Hartley Sweeten
@ 2017-05-13 18:26   ` Florian Fainelli
  0 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-05-13 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
> This board uses a GPIO for the MMC card detect. Let the mmc_spi
> driver handle it instead of the platform code.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Tested-by: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources
  2017-02-21 18:15 ` [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources H Hartley Sweeten
@ 2017-05-13 18:26   ` Florian Fainelli
  0 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-05-13 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
> The ts-72xx watchdog uses two byte sized registers. Tidy up the resource
> declaration so that the proper information is shown in /proc/iomem.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards
  2017-02-21 18:15 ` [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards H Hartley Sweeten
@ 2017-05-13 18:54   ` Florian Fainelli
  0 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-05-13 18:54 UTC (permalink / raw)
  To: linux-arm-kernel

Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
> Register the TI TMP122 (lm70) temperature sensor driver for the TS-72xx
> boards.
> 
> Originaly from Florian Fainelli. Updated to the new spi-ep93xx chip select
> method.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Tested-by: Florian Fainelli <f.fainelli@gmail.com>

root at LEDE:/# cat /sys/class/hwmon/hwmon0/temp1_input
38250
-- 
Florian

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

* [PATCH 0/4] ARM: ep93xx: various updates
  2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
                   ` (3 preceding siblings ...)
  2017-02-21 18:15 ` [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards H Hartley Sweeten
@ 2017-05-13 19:53 ` Florian Fainelli
  4 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-05-13 19:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hartley,

Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
> Here are a couple mach-ep93xx patches that I have been holding on to.
> Some of these have been previously posted.
> 
> The first patch is needed for 128 MiB version of the TS-7300 board.
> That board uses multiple chip selects for the SDRAM and does not boot
> with the previous flatmem setup. With the switch, all the other ep93xx
> boards I have still work properly.
> 
> The second patch has been rebased due to the chip select change in
> the spi-ep93xx driver which has been merged.
> 
> Patch 3 is just a cosmetic change.
> 
> Patch 4 was originally from Florian Fainelli's github ts72xx branch.
> It has been updated to the new spi-ep93xx chip select method.

Patch 4 does no longer apply cleanly because of this commit:

264a4e1c6241fddc5980b3429e133621b3fe01fe ("ARM: EP93xx: Register ethoc
on TS-7300 boards"), do you mind resubmitting so this can be included?

Thanks!

> 
> H Hartley Sweeten (4):
>   ARM: ep93xx: switch to SPARSEMEM
>   ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
>   ARM: ep93xx: tidy up TS-72xx Watchdog resources
>   ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards
> 
>  arch/arm/Kconfig              |  2 +-
>  arch/arm/mach-ep93xx/simone.c | 54 +++----------------------------------------
>  arch/arm/mach-ep93xx/ts72xx.c | 47 +++++++++++++++++++++++++++----------
>  arch/arm/mach-ep93xx/ts72xx.h |  3 ---
>  4 files changed, 39 insertions(+), 67 deletions(-)
> 


-- 
Florian

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-05-13 18:21   ` Florian Fainelli
@ 2017-05-26 16:13     ` Florian Fainelli
  2017-05-26 21:28       ` Alexander Sverdlin
  2017-05-26 22:39       ` Russell King - ARM Linux
  0 siblings, 2 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-05-26 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

Le 05/13/17 ? 11:21, Florian Fainelli a ?crit :
> Le 02/21/17 ? 10:15, H Hartley Sweeten a ?crit :
>> The EP93xx has four chip selects that can be used for the SDRAM memory.
>> These chip selects are decoded to specify an address domain:
>>
>>   SDCS3  0x00000000-0x0fffffff with Boot Option ASDO=1
>>   SDCS0  0xc0000000-0xcfffffff
>>   SDCS1  0xd0000000-0xdfffffff
>>   SDCS2  0xe0000000-x0efffffff
>>   SDCS3  0xf0000000-0xffffffff with Boot Option ASDO=0
>>
>> Because of the row/column/bank architecture of SDRAM, the mapping of
>> these memories into the processor's memory space is discontiguous.
>>
>> Most ep93xx systems only use one of the chip selects. For these systems,
>> ARCH_HAS_HOLES_MEMORYMODEL has worked fine to handle the discontiguous
>> memory.
>>
>> But, some of the TS-72xx boards use multiple chip selects. The TS-7300 in
>> particular uses SDCS3 (with ASDO=1) and SDCS2. On that system with
>> ARCH_HAS_HOLES_MEMORYMODEL the SDCS2 memory does not get handled correctly
>> and results in the system not booting.
>>
>> Change the EP93xx to ARCH_SPARSEMEM_ENABLE. This handles the discontiguous
>> memory for all configurations.
>>
>> This has been tested on the following ep93xx platforms:
>>
>> EDB9307A with 64 MiB on SDCS0
>> Vision EP9307 with 64 MiB on SDCS0
>> TS-7300 with 64 MiB on SDCS3 (with ASDO=1) and 64 MiB on SDCS2
>> sim.one with 64 MiB on SDCS0
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>> Tested-by: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Russell King <linux@armlinux.org.uk>
> 
> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> On a TS-3700 with 32MiB of SDRAM, thanks!
> 

OK this is weird, this patch applied against v4.11 works fine on a 32MB
board configuration, but applied against v4.12-rc2 I now get the following:

Uncompressing Linux... done, booting the kernel.
Warning: Neither atags nor dtb found

as if r2 was lost somehow.

I will start a bisection to figure out if/when it started to break.
Russell do you have an idea?
-- 
Florian

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-05-26 16:13     ` Florian Fainelli
@ 2017-05-26 21:28       ` Alexander Sverdlin
  2017-05-26 21:50         ` Florian Fainelli
  2017-05-26 22:39       ` Russell King - ARM Linux
  1 sibling, 1 reply; 15+ messages in thread
From: Alexander Sverdlin @ 2017-05-26 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Florian,

On 26/05/17 18:13, Florian Fainelli wrote:
>>> The EP93xx has four chip selects that can be used for the SDRAM memory.
>>> These chip selects are decoded to specify an address domain:
>>>
>>>   SDCS3  0x00000000-0x0fffffff with Boot Option ASDO=1
>>>   SDCS0  0xc0000000-0xcfffffff
>>>   SDCS1  0xd0000000-0xdfffffff
>>>   SDCS2  0xe0000000-x0efffffff
>>>   SDCS3  0xf0000000-0xffffffff with Boot Option ASDO=0
>>>
>>> Because of the row/column/bank architecture of SDRAM, the mapping of
>>> these memories into the processor's memory space is discontiguous.
>>>
>>> Most ep93xx systems only use one of the chip selects. For these systems,
>>> ARCH_HAS_HOLES_MEMORYMODEL has worked fine to handle the discontiguous
>>> memory.
>>>
>>> But, some of the TS-72xx boards use multiple chip selects. The TS-7300 in
>>> particular uses SDCS3 (with ASDO=1) and SDCS2. On that system with
>>> ARCH_HAS_HOLES_MEMORYMODEL the SDCS2 memory does not get handled correctly
>>> and results in the system not booting.
>>>
>>> Change the EP93xx to ARCH_SPARSEMEM_ENABLE. This handles the discontiguous
>>> memory for all configurations.
>>>
>>> This has been tested on the following ep93xx platforms:
>>>
>>> EDB9307A with 64 MiB on SDCS0
>>> Vision EP9307 with 64 MiB on SDCS0
>>> TS-7300 with 64 MiB on SDCS3 (with ASDO=1) and 64 MiB on SDCS2
>>> sim.one with 64 MiB on SDCS0
>>>
>>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>>> Tested-by: Linus Walleij <linus.walleij@linaro.org>
>>> Cc: Russell King <linux@armlinux.org.uk>
>> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
>>
>> On a TS-3700 with 32MiB of SDRAM, thanks!
>>
> OK this is weird, this patch applied against v4.11 works fine on a 32MB
> board configuration, but applied against v4.12-rc2 I now get the following:
> 
> Uncompressing Linux... done, booting the kernel.
> Warning: Neither atags nor dtb found
> 
> as if r2 was lost somehow.
> 
> I will start a bisection to figure out if/when it started to break.
> Russell do you have an idea?

I've applied the patch to 4.12-rc2 as well (to be more precise, 1b8f2ffc of Linus's tree),
and it boots fine on EDB9302 (32MiB one chip on SDCS3). I even ran "memtester" fine, one
iteration.

So, from my PoV
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

--
Regards,
Alexander.

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-05-26 21:28       ` Alexander Sverdlin
@ 2017-05-26 21:50         ` Florian Fainelli
  2017-05-26 21:54           ` Hartley Sweeten
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Fainelli @ 2017-05-26 21:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/26/2017 02:28 PM, Alexander Sverdlin wrote:
> Hello Florian,
> 
> On 26/05/17 18:13, Florian Fainelli wrote:
>>>> The EP93xx has four chip selects that can be used for the SDRAM memory.
>>>> These chip selects are decoded to specify an address domain:
>>>>
>>>>   SDCS3  0x00000000-0x0fffffff with Boot Option ASDO=1
>>>>   SDCS0  0xc0000000-0xcfffffff
>>>>   SDCS1  0xd0000000-0xdfffffff
>>>>   SDCS2  0xe0000000-x0efffffff
>>>>   SDCS3  0xf0000000-0xffffffff with Boot Option ASDO=0
>>>>
>>>> Because of the row/column/bank architecture of SDRAM, the mapping of
>>>> these memories into the processor's memory space is discontiguous.
>>>>
>>>> Most ep93xx systems only use one of the chip selects. For these systems,
>>>> ARCH_HAS_HOLES_MEMORYMODEL has worked fine to handle the discontiguous
>>>> memory.
>>>>
>>>> But, some of the TS-72xx boards use multiple chip selects. The TS-7300 in
>>>> particular uses SDCS3 (with ASDO=1) and SDCS2. On that system with
>>>> ARCH_HAS_HOLES_MEMORYMODEL the SDCS2 memory does not get handled correctly
>>>> and results in the system not booting.
>>>>
>>>> Change the EP93xx to ARCH_SPARSEMEM_ENABLE. This handles the discontiguous
>>>> memory for all configurations.
>>>>
>>>> This has been tested on the following ep93xx platforms:
>>>>
>>>> EDB9307A with 64 MiB on SDCS0
>>>> Vision EP9307 with 64 MiB on SDCS0
>>>> TS-7300 with 64 MiB on SDCS3 (with ASDO=1) and 64 MiB on SDCS2
>>>> sim.one with 64 MiB on SDCS0
>>>>
>>>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>>>> Tested-by: Linus Walleij <linus.walleij@linaro.org>
>>>> Cc: Russell King <linux@armlinux.org.uk>
>>> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
>>>
>>> On a TS-3700 with 32MiB of SDRAM, thanks!
>>>
>> OK this is weird, this patch applied against v4.11 works fine on a 32MB
>> board configuration, but applied against v4.12-rc2 I now get the following:
>>
>> Uncompressing Linux... done, booting the kernel.
>> Warning: Neither atags nor dtb found
>>
>> as if r2 was lost somehow.
>>
>> I will start a bisection to figure out if/when it started to break.
>> Russell do you have an idea?
> 
> I've applied the patch to 4.12-rc2 as well (to be more precise, 1b8f2ffc of Linus's tree),
> and it boots fine on EDB9302 (32MiB one chip on SDCS3). I even ran "memtester" fine, one
> iteration.

I need to debug this further because it does not make sense to me why
this patch on 4.12-rc1 works but on on 4.1-2-rc2 other than just having
a bit more bloat one image vs. another.

Thanks!

> 
> So, from my PoV
> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> 
> --
> Regards,
> Alexander.
> 


-- 
Florian

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-05-26 21:50         ` Florian Fainelli
@ 2017-05-26 21:54           ` Hartley Sweeten
  0 siblings, 0 replies; 15+ messages in thread
From: Hartley Sweeten @ 2017-05-26 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday, May 26, 2017 2:50 PM, Florian Fainelli wrote:
> On 05/26/2017 02:28 PM, Alexander Sverdlin wrote:
>> I've applied the patch to 4.12-rc2 as well (to be more precise, 1b8f2ffc of Linus's tree),
>> and it boots fine on EDB9302 (32MiB one chip on SDCS3). I even ran "memtester" fine, one
>> iteration.
>
> I need to debug this further because it does not make sense to me why
> this patch on 4.12-rc1 works but on on 4.1-2-rc2 other than just having
> a bit more bloat one image vs. another.

The bloat might be the problem.

In my earlier testing with the TS-7300 I found that if my uncompressed image/rootfs was
larger than then SDRAM segment size the system would not boot. I think I sent an email
to you regarding this when I was first trying to get the TS-7300 to boot a newer kernel.

Hartley

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

* [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM
  2017-05-26 16:13     ` Florian Fainelli
  2017-05-26 21:28       ` Alexander Sverdlin
@ 2017-05-26 22:39       ` Russell King - ARM Linux
  1 sibling, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2017-05-26 22:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 26, 2017 at 09:13:36AM -0700, Florian Fainelli wrote:
> OK this is weird, this patch applied against v4.11 works fine on a 32MB
> board configuration, but applied against v4.12-rc2 I now get the following:
> 
> Uncompressing Linux... done, booting the kernel.
> Warning: Neither atags nor dtb found
> 
> as if r2 was lost somehow.
> 
> I will start a bisection to figure out if/when it started to break.
> Russell do you have an idea?

I've seen it on other platforms where the dtb is placed too close to
the kernel image, so when the decompressor relocates itself, it ends
up overwriting the dtb.

Remember that the bigger the decompressed kernel image, the higher
the decompressor relocates itself in memory.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

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

end of thread, other threads:[~2017-05-26 22:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 18:15 [PATCH 0/4] ARM: ep93xx: various updates H Hartley Sweeten
2017-02-21 18:15 ` [PATCH 1/4] ARM: ep93xx: switch to SPARSEMEM H Hartley Sweeten
2017-05-13 18:21   ` Florian Fainelli
2017-05-26 16:13     ` Florian Fainelli
2017-05-26 21:28       ` Alexander Sverdlin
2017-05-26 21:50         ` Florian Fainelli
2017-05-26 21:54           ` Hartley Sweeten
2017-05-26 22:39       ` Russell King - ARM Linux
2017-02-21 18:15 ` [PATCH 2/4] ARM: ep93xx: simone: let the mmc_spi driver handle the card detect H Hartley Sweeten
2017-05-13 18:26   ` Florian Fainelli
2017-02-21 18:15 ` [PATCH 3/4] ARM: ep93xx: tidy up TS-72xx Watchdog resources H Hartley Sweeten
2017-05-13 18:26   ` Florian Fainelli
2017-02-21 18:15 ` [PATCH 4/4] ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards H Hartley Sweeten
2017-05-13 18:54   ` Florian Fainelli
2017-05-13 19:53 ` [PATCH 0/4] ARM: ep93xx: various updates Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.