mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/7] arm: export arch_number to env
@ 2011-09-16 12:23 Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 2/7] at91: fix cpu clock speed display Jean-Christophe PLAGNIOL-VILLARD
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

so we can dynamise the boot depending on the machine

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/lib/armlinux.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index 5bdbb92..9f2ecd2 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -184,9 +184,16 @@ void armlinux_set_bootparams(void *params)
 	armlinux_bootparams = params;
 }
 
+static char *arch_number;
+
 void armlinux_set_architecture(int architecture)
 {
 	armlinux_architecture = architecture;
+
+	kfree(arch_number);
+	arch_number = asprintf("%d", architecture);
+	setenv("arch_number", arch_number);
+	export("arch_number");
 }
 
 void armlinux_set_revision(unsigned int rev)
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/7] at91: fix cpu clock speed display
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 3/7] at91: Fix uhpck clock rate in upll case Jean-Christophe PLAGNIOL-VILLARD
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-at91/clock.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 528994f..c9c32b2 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -535,6 +535,7 @@ static void at91_upll_usbfs_clock_init(unsigned long main_clock)
 }
 
 static int pll_overclock = 0;
+static u32 cpu_freq = 0;
 
 int at91_clock_init(unsigned long main_clock)
 {
@@ -622,6 +623,8 @@ int at91_clock_init(unsigned long main_clock)
 		mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8));      /* mdiv */
 	}
 
+	cpu_freq = freq;
+
 	/* Register the PMC's standard clocks */
 	for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
 		at91_clk_add(standard_pmc_clocks[i]);
@@ -649,8 +652,8 @@ static int at91_clock_display(void)
 	if (pll_overclock)
 		pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
 
-	printf("Clocks: CPU %lu MHz, master %u MHz, main %u.%03u MHz\n",
-		mck.parent->rate_hz / 1000000, (unsigned) mck.rate_hz / 1000000,
+	printf("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n",
+		cpu_freq / 1000000, (unsigned) mck.rate_hz / 1000000,
 		(unsigned) main_clk.rate_hz / 1000000,
 		((unsigned) main_clk.rate_hz % 1000000) / 1000);
 
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/7] at91: Fix uhpck clock rate in upll case
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 2/7] at91: fix cpu clock speed display Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

from linux
commit 8251544f9e28058e54c4f35b7cd13b0d191d7555
Author: Ryan Mallon <ryan@bluewatersys.com>

The uhpck clock should be divided from the utmi clock, not its parent
(main). This change is mostly cosmetic as the uhpck rate value is not
used anywhere except for the debugfs clock output.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-at91/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index c9c32b2..0406382 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -530,7 +530,7 @@ static void at91_upll_usbfs_clock_init(unsigned long main_clock)
 	/* Now set uhpck values */
 	uhpck.parent = &utmi_clk;
 	uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
-	uhpck.rate_hz = utmi_clk.parent->rate_hz;
+	uhpck.rate_hz = utmi_clk.rate_hz;
 	uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8);
 }
 
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 2/7] at91: fix cpu clock speed display Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 3/7] at91: Fix uhpck clock rate in upll case Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-19  9:18   ` Sascha Hauer
  2011-09-16 12:23 ` [PATCH 5/7] resource: introduce add_generic_device_res to add multiple resource Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9260ek/init.c     |    2 +-
 arch/arm/boards/at91sam9263ek/init.c     |    2 +-
 arch/arm/boards/pm9263/init.c            |    2 +-
 arch/arm/mach-at91/at91sam9g45_devices.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index 861e898..e4b98bf 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -64,7 +64,7 @@ static struct atmel_nand_data nand_pdata = {
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
 	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC),
-	.ecc_mode	= NAND_ECC_HW,
+	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PC13,
 	.enable_pin	= AT91_PIN_PC14,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c
index 46f3a7e..9e0981f 100644
--- a/arch/arm/boards/at91sam9263ek/init.c
+++ b/arch/arm/boards/at91sam9263ek/init.c
@@ -45,7 +45,7 @@ static struct atmel_nand_data nand_pdata = {
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
 	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC0),
-	.ecc_mode	= NAND_ECC_HW,
+	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PA22,
 	.enable_pin	= AT91_PIN_PD15,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c
index aeca4e7..a1fe0cd 100644
--- a/arch/arm/boards/pm9263/init.c
+++ b/arch/arm/boards/pm9263/init.c
@@ -44,7 +44,7 @@ static struct atmel_nand_data nand_pdata = {
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
 	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC0),
-	.ecc_mode	= NAND_ECC_HW,
+	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PB30,
 	.enable_pin	= AT91_PIN_PD15,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index f311b62..e18682b 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -71,7 +71,7 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 		return;
 
 	data->ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC);
-	data->ecc_mode = NAND_ECC_HW;
+	data->ecc_mode	= NAND_ECC_SOFT;
 
 	csa = at91_sys_read(AT91_MATRIX_EBICSA);
 	at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 5/7] resource: introduce add_generic_device_res to add multiple resource
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 preceding siblings ...)
  2011-09-16 12:23 ` [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 6/7] at91: nand switch ecc base to resource Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/base/resource.c |   67 ++++++++++++++++++++++++----------------------
 include/driver.h        |    7 +++++
 2 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/drivers/base/resource.c b/drivers/base/resource.c
index 175beb9..f6c429f 100644
--- a/drivers/base/resource.c
+++ b/drivers/base/resource.c
@@ -41,33 +41,42 @@ struct device_d *add_generic_device(const char* devname, int id, const char *res
 		resource_size_t start, resource_size_t size, unsigned int flags,
 		void *pdata)
 {
+	struct resource *res;
+
+	res = xzalloc(sizeof(struct resource));
+	if (resname)
+		res[0].name = xstrdup(resname);
+	res[0].start = start;
+	res[0].size = size;
+	res[0].flags = flags;
+
+	return add_generic_device_res(devname, id, res, 1, pdata);
+}
+EXPORT_SYMBOL(add_generic_device);
+
+struct device_d *add_generic_device_res(const char* devname, int id,
+		struct resource *res, int nb, void *pdata)
+{
 	struct device_d *dev;
 
 	dev = alloc_device(devname, id, pdata);
-	dev->resource = xzalloc(sizeof(struct resource));
-	dev->num_resources = 1;
-	if (resname)
-		dev->resource[0].name = xstrdup(resname);
-	dev->resource[0].start = start;
-	dev->resource[0].size = size;
-	dev->resource[0].flags = flags;
+	dev->resource = res;
+	dev->num_resources = nb;
 
 	register_device(dev);
 
 	return dev;
 }
-EXPORT_SYMBOL(add_generic_device);
+EXPORT_SYMBOL(add_generic_device_res);
 
 #ifdef CONFIG_DRIVER_NET_DM9000
 struct device_d *add_dm9000_device(int id, resource_size_t base,
 		resource_size_t data, int flags, void *pdata)
 {
-	struct device_d *dev;
+	struct resource *res;
 	resource_size_t size;
 
-	dev = alloc_device("dm9000", id, pdata);
-	dev->resource = xzalloc(sizeof(struct resource) * 2);
-	dev->num_resources = 2;
+	res = xzalloc(sizeof(struct resource) * 2);
 
 	switch (flags) {
 	case IORESOURCE_MEM_32BIT:
@@ -84,16 +93,14 @@ struct device_d *add_dm9000_device(int id, resource_size_t base,
 		return NULL;
 	}
 
-	dev->resource[0].start = base;
-	dev->resource[0].size = size;
-	dev->resource[0].flags = IORESOURCE_MEM | flags;
-	dev->resource[1].start = data;
-	dev->resource[1].size = size;
-	dev->resource[1].flags = IORESOURCE_MEM | flags;
-
-	register_device(dev);
+	res[0].start = base;
+	res[0].size = size;
+	res[0].flags = IORESOURCE_MEM | flags;
+	res[1].start = data;
+	res[1].size = size;
+	res[1].flags = IORESOURCE_MEM | flags;
 
-	return dev;
+	return add_generic_device_res("dm9000", id, res, 2, pdata);
 }
 EXPORT_SYMBOL(add_dm9000_device);
 #endif
@@ -102,19 +109,15 @@ EXPORT_SYMBOL(add_dm9000_device);
 struct device_d *add_usb_ehci_device(int id, resource_size_t hccr,
 		resource_size_t hcor, void *pdata)
 {
-	struct device_d *dev;
-
-	dev = alloc_device("ehci", id, pdata);
-	dev->resource = xzalloc(sizeof(struct resource) * 2);
-	dev->num_resources = 2;
-	dev->resource[0].start = hccr;
-	dev->resource[0].flags = IORESOURCE_MEM;
-	dev->resource[1].start = hcor;
-	dev->resource[1].flags = IORESOURCE_MEM;
+	resource_size_t *res;
 
-	register_device(dev);
+	res = xzalloc(sizeof(struct resource) * 2);
+	res[0].start = hccr;
+	res[0].flags = IORESOURCE_MEM;
+	res[1].start = hcor;
+	res[1].flags = IORESOURCE_MEM;
 
-	return dev;
+	return add_generic_device_res("ehci", id, res, 2, pdata);
 }
 EXPORT_SYMBOL(add_usb_ehci_device);
 #endif
diff --git a/include/driver.h b/include/driver.h
index e9ac727..80de0c8 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -205,6 +205,13 @@ struct device_d *add_generic_device(const char* devname, int id, const char *res
 		void *pdata);
 
 /*
+ * register a generic device
+ * with multiple resources
+ */
+struct device_d *add_generic_device_res(const char* devname, int id,
+		struct resource *res, int nb, void *pdata);
+
+/*
  * register a memory device
  */
 static inline struct device_d *add_mem_device(const char *name, resource_size_t start,
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 6/7] at91: nand switch ecc base to resource
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 preceding siblings ...)
  2011-09-16 12:23 ` [PATCH 5/7] resource: introduce add_generic_device_res to add multiple resource Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-16 12:23 ` [PATCH 7/7] usb/core: make print dev like linux lsusb Jean-Christophe PLAGNIOL-VILLARD
  2011-09-19  9:14 ` [PATCH 1/7] arm: export arch_number to env Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9260ek/init.c     |    2 --
 arch/arm/boards/at91sam9261ek/init.c     |    1 -
 arch/arm/boards/at91sam9263ek/init.c     |    2 --
 arch/arm/boards/pm9263/init.c            |    2 --
 arch/arm/mach-at91/at91sam9260_devices.c |   17 +++++++++++++++--
 arch/arm/mach-at91/at91sam9263_devices.c |   17 +++++++++++++++--
 arch/arm/mach-at91/at91sam9g45_devices.c |   20 +++++++++++++++-----
 arch/arm/mach-at91/include/mach/board.h  |    1 -
 drivers/mtd/nand/atmel_nand.c            |    8 ++++----
 9 files changed, 49 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index e4b98bf..8fab557 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -63,8 +63,6 @@ static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
-	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC),
-	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PC13,
 	.enable_pin	= AT91_PIN_PC14,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 73b411a..69111a0 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -43,7 +43,6 @@ static struct atmel_nand_data nand_pdata = {
 	.ale		= 22,
 	.cle		= 21,
 /*	.det_pin	= ... not connected */
-	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PC15,
 	.enable_pin	= AT91_PIN_PC14,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c
index 9e0981f..278e312 100644
--- a/arch/arm/boards/at91sam9263ek/init.c
+++ b/arch/arm/boards/at91sam9263ek/init.c
@@ -44,8 +44,6 @@ static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
-	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC0),
-	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PA22,
 	.enable_pin	= AT91_PIN_PD15,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c
index a1fe0cd..8f451e8 100644
--- a/arch/arm/boards/pm9263/init.c
+++ b/arch/arm/boards/pm9263/init.c
@@ -43,8 +43,6 @@ static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
 	.cle		= 22,
 /*	.det_pin	= ... not connected */
-	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC0),
-	.ecc_mode	= NAND_ECC_SOFT,
 	.rdy_pin	= AT91_PIN_PB30,
 	.enable_pin	= AT91_PIN_PD15,
 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 4540f4b..4607646 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -63,6 +63,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= SZ_256M,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= AT91_BASE_SYS + AT91_ECC,
+		.size	= 512,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 void at91_add_device_nand(struct atmel_nand_data *data)
 {
 	unsigned long csa;
@@ -85,8 +98,8 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 	if (data->det_pin)
 		at91_set_gpio_input(data->det_pin, 1);
 
-	add_generic_device("atmel_nand", 0, NULL, AT91_CHIPSELECT_3, 0x10,
-			   IORESOURCE_MEM, data);
+	add_generic_device_res("atmel_nand", 0, nand_resources,
+			       ARRAY_SIZE(nand_resources), data);
 }
 #else
 void at91_add_device_nand(struct atmel_nand_data *data) {}
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index c7ae45a..f5058dc 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -62,6 +62,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= SZ_256M,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= AT91_BASE_SYS + AT91_ECC0,
+		.size	= 512,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 void at91_add_device_nand(struct atmel_nand_data *data)
 {
 	unsigned long csa;
@@ -84,8 +97,8 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 	if (data->det_pin)
 		at91_set_gpio_input(data->det_pin, 1);
 
-	add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10,
-			   IORESOURCE_MEM, data);
+	add_generic_device_res("atmel_nand", -1, nand_resources,
+			       ARRAY_SIZE(nand_resources), data);
 }
 #else
 void at91_add_device_nand(struct atmel_nand_data *data) {}
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index e18682b..8bc1104 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -63,6 +63,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {}
 #endif
 
 #if defined(CONFIG_NAND_ATMEL)
+static struct resource nand_resources[] = {
+	[0] = {
+		.start	= AT91_CHIPSELECT_3,
+		.size	= SZ_256M,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= AT91_BASE_SYS + AT91_ECC,
+		.size	= 512,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 void at91_add_device_nand(struct atmel_nand_data *data)
 {
 	unsigned long csa;
@@ -70,9 +83,6 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 	if (!data)
 		return;
 
-	data->ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC);
-	data->ecc_mode	= NAND_ECC_SOFT;
-
 	csa = at91_sys_read(AT91_MATRIX_EBICSA);
 	at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
 
@@ -88,8 +98,8 @@ void at91_add_device_nand(struct atmel_nand_data *data)
 	if (data->det_pin)
 		at91_set_gpio_input(data->det_pin, 1);
 
-	add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10,
-			   IORESOURCE_MEM, data);
+	add_generic_device_res("atmel_nand", -1, nand_resources,
+			       ARRAY_SIZE(nand_resources), data);
 }
 #else
 void at91_add_device_nand(struct atmel_nand_data *data) {}
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 2adc035..f970ad8 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -29,7 +29,6 @@ void atmel_nand_load_image(void *dest, int size, int pagesize, int blocksize);
 
  /* NAND / SmartMedia */
 struct atmel_nand_data {
-	void __iomem	*ecc_base;
 	u8		enable_pin;	/* chip enable */
 	u8		det_pin;	/* card detect */
 	u8		rdy_pin;	/* ready/busy */
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f79be9a..0710407 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -399,13 +399,13 @@ static int __init atmel_nand_probe(struct device_d *dev)
 	if (host->board->rdy_pin)
 		nand_chip->dev_ready = atmel_nand_device_ready;
 
-	nand_chip->ecc.mode = pdata->ecc_mode;
+	nand_chip->ecc.mode = NAND_ECC_SOFT;
 
 	if (pdata->ecc_mode == NAND_ECC_HW) {
-		if (!pdata->ecc_base)
-			return -ENODEV;
+		host->ecc = dev_request_mem_region(dev, 1);
 
-		host->ecc = pdata->ecc_base;
+		if (!host->ecc)
+			return -ENODEV;
 
 		nand_chip->ecc.mode = NAND_ECC_HW;
 		nand_chip->ecc.calculate = atmel_nand_calculate;
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 7/7] usb/core: make print dev like linux lsusb
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 preceding siblings ...)
  2011-09-16 12:23 ` [PATCH 6/7] at91: nand switch ecc base to resource Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-16 12:23 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-09-19  9:14 ` [PATCH 1/7] arm: export arch_number to env Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-16 12:23 UTC (permalink / raw)
  To: barebox

and busnum start at 1

as this
Bus 001 Device 002: ID 0b95:7720 AX88772

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/usb/core/usb.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 5dc8afe..24fa94a 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -78,13 +78,14 @@ static LIST_HEAD(usb_device_list);
 
 static void print_usb_device(struct usb_device *dev)
 {
-	printf("%s: %04x:%04x %s\n", dev->dev.name,
-			dev->descriptor.idVendor,
-			dev->descriptor.idProduct,
-			dev->prod);
+	printf("Bus %03d Device %03d: ID %04x:%04x %s\n",
+		dev->host->busnum, dev->devnum,
+		dev->descriptor.idVendor,
+		dev->descriptor.idProduct,
+		dev->prod);
 }
 
-static int host_busnum;
+static int host_busnum = 1;
 
 int usb_register_host(struct usb_host *host)
 {
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/7] arm: export arch_number to env
  2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
                   ` (5 preceding siblings ...)
  2011-09-16 12:23 ` [PATCH 7/7] usb/core: make print dev like linux lsusb Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-19  9:14 ` Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-09-19  9:14 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Fri, Sep 16, 2011 at 02:23:42PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can dynamise the boot depending on the machine
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/lib/armlinux.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index 5bdbb92..9f2ecd2 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -184,9 +184,16 @@ void armlinux_set_bootparams(void *params)
>  	armlinux_bootparams = params;
>  }
>  
> +static char *arch_number;
> +
>  void armlinux_set_architecture(int architecture)
>  {
>  	armlinux_architecture = architecture;
> +
> +	kfree(arch_number);
> +	arch_number = asprintf("%d", architecture);
> +	setenv("arch_number", arch_number);
> +	export("arch_number");
>  }

like this please:

void armlinux_set_architecture(int architecture)
{
	char *arch_number = asprintf("%d", architecture);

	armlinux_architecture = architecture;
	setenv("arch_number", arch_number);
	export("arch_number");

	free(arch_number);
}

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel
  2011-09-16 12:23 ` [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-19  9:18   ` Sascha Hauer
  2011-09-19  9:37     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2011-09-19  9:18 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Fri, Sep 16, 2011 at 02:23:45PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/at91sam9260ek/init.c     |    2 +-
>  arch/arm/boards/at91sam9263ek/init.c     |    2 +-
>  arch/arm/boards/pm9263/init.c            |    2 +-
>  arch/arm/mach-at91/at91sam9g45_devices.c |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
> index 861e898..e4b98bf 100644
> --- a/arch/arm/boards/at91sam9260ek/init.c
> +++ b/arch/arm/boards/at91sam9260ek/init.c
> @@ -64,7 +64,7 @@ static struct atmel_nand_data nand_pdata = {
>  	.cle		= 22,
>  /*	.det_pin	= ... not connected */
>  	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC),
> -	.ecc_mode	= NAND_ECC_HW,
> +	.ecc_mode	= NAND_ECC_SOFT,

What does the Atmel nand bootloader expect (I assume it's possible to
boot from NAND, right?). Is it software or hardware ecc?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel
  2011-09-19  9:18   ` Sascha Hauer
@ 2011-09-19  9:37     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-19  9:37 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 11:18 Mon 19 Sep     , Sascha Hauer wrote:
> On Fri, Sep 16, 2011 at 02:23:45PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  arch/arm/boards/at91sam9260ek/init.c     |    2 +-
> >  arch/arm/boards/at91sam9263ek/init.c     |    2 +-
> >  arch/arm/boards/pm9263/init.c            |    2 +-
> >  arch/arm/mach-at91/at91sam9g45_devices.c |    2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
> > index 861e898..e4b98bf 100644
> > --- a/arch/arm/boards/at91sam9260ek/init.c
> > +++ b/arch/arm/boards/at91sam9260ek/init.c
> > @@ -64,7 +64,7 @@ static struct atmel_nand_data nand_pdata = {
> >  	.cle		= 22,
> >  /*	.det_pin	= ... not connected */
> >  	.ecc_base	= (void __iomem *)(AT91_BASE_SYS + AT91_ECC),
> > -	.ecc_mode	= NAND_ECC_HW,
> > +	.ecc_mode	= NAND_ECC_SOFT,
> 
> What does the Atmel nand bootloader expect (I assume it's possible to
> boot from NAND, right?). Is it software or hardware ecc?
don't care the ecc is not manage by the rom code

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-09-19  9:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 12:23 [PATCH 1/7] arm: export arch_number to env Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 2/7] at91: fix cpu clock speed display Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 3/7] at91: Fix uhpck clock rate in upll case Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel Jean-Christophe PLAGNIOL-VILLARD
2011-09-19  9:18   ` Sascha Hauer
2011-09-19  9:37     ` Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 5/7] resource: introduce add_generic_device_res to add multiple resource Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 6/7] at91: nand switch ecc base to resource Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 7/7] usb/core: make print dev like linux lsusb Jean-Christophe PLAGNIOL-VILLARD
2011-09-19  9:14 ` [PATCH 1/7] arm: export arch_number to env Sascha Hauer

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