mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/7] Adding pcm051 support
@ 2012-12-18 14:13 Teresa Gámez
  2012-12-18 14:13 ` [PATCH 1/7] ARM OMAP4: Add SRAM base define Teresa Gámez
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox

This patch stack is based on top of the patch series AM33XX support
by Jan Luebbe.
It includes the wrapper for adding omap devices and pcm051 support.

Teresa Gámez (7):
  ARM OMAP4: Add SRAM base define
  ARM OMAP4: Add EHCI base define
  ARM AM33XX: Add MMC Bases
  ARM OMAP: Create device file
  ARM OMAP: Use wrapper in board files
  ARM AM33XX: Add mmc0 pin mux function
  pcm051: Add inital support

 arch/arm/Makefile                                |    1 +
 arch/arm/boards/archosg9/board.c                 |   19 ++----
 arch/arm/boards/beagle/board.c                   |   20 ++----
 arch/arm/boards/beaglebone/board.c               |   17 +----
 arch/arm/boards/omap343xdsp/board.c              |   12 +--
 arch/arm/boards/omap3evm/board.c                 |   20 ++----
 arch/arm/boards/panda/board.c                    |   22 ++-----
 arch/arm/boards/pcm049/board.c                   |   21 ++----
 arch/arm/boards/pcm051/Makefile                  |    1 +
 arch/arm/boards/pcm051/board.c                   |   64 ++++++++++++++++++
 arch/arm/boards/pcm051/config.h                  |   21 ++++++
 arch/arm/boards/pcm051/env/boot/sd               |   10 +++
 arch/arm/boards/pcm051/env/config                |   22 ++++++
 arch/arm/boards/phycard-a-l1/pca-a-l1.c          |   20 ++----
 arch/arm/boards/phycard-a-xl2/pca-a-xl2.c        |   21 ++----
 arch/arm/configs/pcm051_defconfig                |   56 ++++++++++++++++
 arch/arm/mach-omap/Kconfig                       |   10 +++
 arch/arm/mach-omap/Makefile                      |    4 +-
 arch/arm/mach-omap/am33xx_mux.c                  |    5 ++
 arch/arm/mach-omap/devices.c                     |   69 +++++++++++++++++++
 arch/arm/mach-omap/include/mach/am33xx-devices.h |   36 ++++++++++
 arch/arm/mach-omap/include/mach/am33xx-mux.h     |    1 +
 arch/arm/mach-omap/include/mach/am33xx-silicon.h |    2 +
 arch/arm/mach-omap/include/mach/devices.h        |   27 ++++++++
 arch/arm/mach-omap/include/mach/omap3-devices.h  |   60 ++++++++++++++++-
 arch/arm/mach-omap/include/mach/omap4-devices.h  |   77 ++++++++++++++++++++++
 arch/arm/mach-omap/include/mach/omap4-silicon.h  |    5 ++
 27 files changed, 517 insertions(+), 126 deletions(-)
 create mode 100644 arch/arm/boards/pcm051/Makefile
 create mode 100644 arch/arm/boards/pcm051/board.c
 create mode 100644 arch/arm/boards/pcm051/config.h
 create mode 100644 arch/arm/boards/pcm051/env/boot/sd
 create mode 100644 arch/arm/boards/pcm051/env/config
 create mode 100644 arch/arm/configs/pcm051_defconfig
 create mode 100644 arch/arm/mach-omap/devices.c
 create mode 100644 arch/arm/mach-omap/include/mach/am33xx-devices.h
 create mode 100644 arch/arm/mach-omap/include/mach/devices.h
 create mode 100644 arch/arm/mach-omap/include/mach/omap4-devices.h


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

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

* [PATCH 1/7] ARM OMAP4: Add SRAM base define
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 14:13 ` [PATCH 2/7] ARM OMAP4: Add EHCI " Teresa Gámez
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/include/mach/omap4-silicon.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 5755856..1d236f2 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -39,6 +39,8 @@
 #define OMAP44XX_L4_WKUP_BASE		0x4A300000
 #define OMAP44XX_L4_PER_BASE		0x48000000
 
+#define OMAP44XX_SRAM_BASE		0x40300000
+
 /* EMIF and DMM registers */
 #define OMAP44XX_EMIF1_BASE		0x4c000000
 #define OMAP44XX_EMIF2_BASE		0x4d000000
-- 
1.7.0.4


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

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

* [PATCH 2/7] ARM OMAP4: Add EHCI base define
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
  2012-12-18 14:13 ` [PATCH 1/7] ARM OMAP4: Add SRAM base define Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 14:13 ` [PATCH 3/7] ARM AM33XX: Add MMC Bases Teresa Gámez
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/include/mach/omap4-silicon.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 1d236f2..a5cc221 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -121,6 +121,9 @@
 /* GPMC */
 #define OMAP44XX_GPMC_BASE		0x50000000
 
+/* EHCI */
+#define OMAP44XX_EHCI_BASE		(OMAP44XX_L4_CORE_BASE + 0x64C00)
+
 /* DMM */
 #define OMAP44XX_DMM_BASE		0x4E000000
 #define DMM_LISA_MAP_BASE		(OMAP44XX_DMM_BASE + 0x40)
-- 
1.7.0.4


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

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

* [PATCH 3/7] ARM AM33XX: Add MMC Bases
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
  2012-12-18 14:13 ` [PATCH 1/7] ARM OMAP4: Add SRAM base define Teresa Gámez
  2012-12-18 14:13 ` [PATCH 2/7] ARM OMAP4: Add EHCI " Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 14:13 ` [PATCH 4/7] ARM OMAP: Create device file Teresa Gámez
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/include/mach/am33xx-silicon.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/am33xx-silicon.h b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
index ea44d25..4bfcebd 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-silicon.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
@@ -38,6 +38,8 @@
 
 /* MMC */
 #define AM33XX_MMCHS0_BASE		(AM33XX_L4_PER_BASE + 0x60000)
+#define AM33XX_MMC1_BASE		(AM33XX_L4_PER_BASE + 0x1D8000)
+#define AM33XX_MMCHS2_BASE		0x47810000
 
 /* DTMTimer0 */
 #define AM33XX_DMTIMER0_BASE		(AM33XX_L4_WKUP_BASE + 0x205000)
-- 
1.7.0.4


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

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

* [PATCH 4/7] ARM OMAP: Create device file
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
                   ` (2 preceding siblings ...)
  2012-12-18 14:13 ` [PATCH 3/7] ARM AM33XX: Add MMC Bases Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 17:29   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-12-18 14:13 ` [PATCH 5/7] ARM OMAP: Use wrapper in board files Teresa Gámez
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox

Created wrapper to add omap devices.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/Makefile                      |    4 +-
 arch/arm/mach-omap/devices.c                     |   69 +++++++++++++++++++
 arch/arm/mach-omap/include/mach/am33xx-devices.h |   36 ++++++++++
 arch/arm/mach-omap/include/mach/devices.h        |   27 ++++++++
 arch/arm/mach-omap/include/mach/omap3-devices.h  |   60 ++++++++++++++++-
 arch/arm/mach-omap/include/mach/omap4-devices.h  |   77 ++++++++++++++++++++++
 6 files changed, 269 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-omap/devices.c
 create mode 100644 arch/arm/mach-omap/include/mach/am33xx-devices.h
 create mode 100644 arch/arm/mach-omap/include/mach/devices.h
 create mode 100644 arch/arm/mach-omap/include/mach/omap4-devices.h

diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index 1536744..494da4e 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -15,8 +15,8 @@
 # GNU General Public License for more details.
 #
 #
-obj-$(CONFIG_ARCH_OMAP) += syslib.o
-pbl-$(CONFIG_ARCH_OMAP) += syslib.o
+obj-$(CONFIG_ARCH_OMAP) += syslib.o devices.o
+pbl-$(CONFIG_ARCH_OMAP) += syslib.o devices.o
 obj-$(CONFIG_OMAP_CLOCK_SOURCE_S32K) += s32k_clksource.o
 obj-$(CONFIG_OMAP_CLOCK_SOURCE_DMTIMER0) += dmtimer0.o
 obj-$(CONFIG_ARCH_OMAP3) += omap3_core.o omap3_generic.o auxcr.o
diff --git a/arch/arm/mach-omap/devices.c b/arch/arm/mach-omap/devices.c
new file mode 100644
index 0000000..011db5a
--- /dev/null
+++ b/arch/arm/mach-omap/devices.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Teresa Gámez, Phytec Messtechnik GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <driver.h>
+#include <sizes.h>
+#include <ns16550.h>
+#include <asm/armlinux.h>
+#include <mach/devices.h>
+
+static inline struct device_d *omap_add_device(char *name, resource_size_t base,
+					resource_size_t size, void *pdata)
+{
+	return add_generic_device(name, DEVICE_ID_DYNAMIC, NULL,
+				base, size, IORESOURCE_MEM, pdata);
+}
+
+void omap_add_ram0(resource_size_t size)
+{
+	arm_add_mem_device("ram0", 0x80000000, size);
+}
+
+void omap_add_sram0(resource_size_t base, resource_size_t size)
+{
+	add_mem_device("sram0", base, size, IORESOURCE_MEM_WRITEABLE);
+}
+
+static struct NS16550_plat serial_plat = {
+	.clock = 48000000,      /* 48MHz (APLL96/2) */
+	.shift = 2,
+};
+
+struct device_d *omap_add_ns16550(resource_size_t base)
+{
+	return add_ns16550_device(DEVICE_ID_DYNAMIC, base, SZ_1K,
+				IORESOURCE_MEM_8BIT, &serial_plat);
+}
+
+struct device_d *omap_add_mmc(resource_size_t base, void *pdata)
+{
+	return omap_add_device("omap-hsmmc", base, SZ_4K, pdata);
+}
+
+struct device_d *omap_add_i2c(resource_size_t base, void *pdata)
+{
+	return omap_add_device("i2c-omap", base, SZ_4K, pdata);
+}
+
+struct device_d *omap_add_spi(int id, resource_size_t base, void *pdata)
+{
+	 return add_generic_device("omap3_spi", id, NULL,
+			base, SZ_4K, IORESOURCE_MEM, pdata);
+}
diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
new file mode 100644
index 0000000..40ce854
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
@@ -0,0 +1,36 @@
+#include <driver.h>
+#include <sizes.h>
+
+#include <mach/devices.h>
+#include <mach/mcspi.h>
+#include <mach/am33xx-silicon.h>
+
+static inline struct device_d *am33xx_add_ns16550_uart0(void)
+{
+	return omap_add_ns16550(AM33XX_UART0_BASE);
+}
+
+static inline struct device_d *am33xx_add_ns16550_uart1(void)
+{
+	return omap_add_ns16550(AM33XX_UART1_BASE);
+}
+
+static inline struct device_d *am33xx_add_ns16550_uart2(void)
+{
+	return omap_add_ns16550(AM33XX_UART2_BASE);
+}
+
+static inline struct device_d *am33xx_add_mmc0(void *pdata)
+{
+	return omap_add_mmc(AM33XX_MMCHS0_BASE + 0x100, pdata);
+}
+
+static inline struct device_d *am33xx_add_mmc1(void *pdata)
+{
+	return omap_add_mmc(AM33XX_MMC1_BASE + 0x100, pdata);
+}
+
+static inline struct device_d *am33xx_add_mmc2(void *pdata)
+{
+	return omap_add_mmc(AM33XX_MMCHS2_BASE + 0x100, pdata);
+}
diff --git a/arch/arm/mach-omap/include/mach/devices.h b/arch/arm/mach-omap/include/mach/devices.h
new file mode 100644
index 0000000..3841558
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/devices.h
@@ -0,0 +1,27 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __ASM_ARCH_OMAP_DEVICES_H
+#define __ASM_ARCH_OMAP_DEVICES_H
+
+void omap_add_ram0(resource_size_t size);
+void omap_add_sram0(resource_size_t base, resource_size_t size);
+struct device_d *omap_add_ns16550(resource_size_t base);
+struct device_d *omap_add_mmc(resource_size_t base, void *pdata);
+struct device_d *omap_add_i2c(resource_size_t base, void *pdata);
+struct device_d *omap_add_spi(int id, resource_size_t base, void *pdata);
+
+#endif
diff --git a/arch/arm/mach-omap/include/mach/omap3-devices.h b/arch/arm/mach-omap/include/mach/omap3-devices.h
index 8a6b324..35ee51c 100644
--- a/arch/arm/mach-omap/include/mach/omap3-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap3-devices.h
@@ -1,14 +1,70 @@
 #include <driver.h>
 #include <sizes.h>
 
+#include <mach/devices.h>
 #include <mach/mcspi.h>
+#include <mach/omap3-silicon.h>
+
+static inline void omap3_add_sram0(void)
+{
+	return omap_add_sram0(OMAP_SRAM_BASE, 64 * SZ_1K);
+}
+
+static inline struct device_d *omap3_add_ns16550_uart1(void)
+{
+	return omap_add_ns16550(OMAP_UART1_BASE);
+}
+
+static inline struct device_d *omap3_add_ns16550_uart2(void)
+{
+	return omap_add_ns16550(OMAP_UART2_BASE);
+}
+
+static inline struct device_d *omap3_add_ns16550_uart3(void)
+{
+	return omap_add_ns16550(OMAP_UART3_BASE);
+}
+static inline struct device_d *omap3_add_i2c1(void *pdata)
+{
+	return omap_add_i2c(OMAP_I2C1_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_i2c2(void *pdata)
+{
+	return omap_add_i2c(OMAP_I2C2_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_i2c3(void *pdata)
+{
+	return omap_add_i2c(OMAP_I2C3_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_mmc1(void *pdata)
+{
+	return omap_add_mmc(OMAP_MMC1_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_mmc2(void *pdata)
+{
+	return omap_add_mmc(OMAP_MMC2_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_mmc3(void *pdata)
+{
+	return omap_add_mmc(OMAP_MMC3_BASE, pdata);
+}
+
+static inline struct device_d *omap3_add_ehci(void *pdata)
+{
+	return  add_usb_ehci_device(DEVICE_ID_DYNAMIC,  OMAP_EHCI_BASE,
+					OMAP_EHCI_BASE + 0x10, pdata);
+}
 
 /* the device numbering is the same as in the device tree */
 
 static inline struct device_d *omap3_add_spi(int id, resource_size_t start)
 {
-	return add_generic_device("omap3_spi", id, NULL, start, SZ_4K,
-				   IORESOURCE_MEM, NULL);
+	return omap_add_spi(id, start, NULL);
 }
 
 static inline struct device_d *omap3_add_spi1(void)
diff --git a/arch/arm/mach-omap/include/mach/omap4-devices.h b/arch/arm/mach-omap/include/mach/omap4-devices.h
new file mode 100644
index 0000000..0f58cc9
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/omap4-devices.h
@@ -0,0 +1,77 @@
+#include <driver.h>
+#include <sizes.h>
+
+#include <mach/devices.h>
+#include <mach/omap4-silicon.h>
+
+static inline void omap4_add_sram0(void)
+{
+	return omap_add_sram0(OMAP44XX_SRAM_BASE, 48 * SZ_1K);
+}
+
+static inline struct device_d *omap4_add_ns16550_uart1(void)
+{
+	return omap_add_ns16550(OMAP44XX_UART1_BASE);
+}
+
+static inline struct device_d *omap4_add_ns16550_uart2(void)
+{
+	return omap_add_ns16550(OMAP44XX_UART2_BASE);
+}
+
+static inline struct device_d *omap4_add_ns16550_uart3(void)
+{
+	return omap_add_ns16550(OMAP44XX_UART3_BASE);
+}
+
+static inline struct device_d *omap4_add_i2c1(void *pdata)
+{
+	return omap_add_i2c(OMAP44XX_I2C1_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_i2c2(void *pdata)
+{
+	return omap_add_i2c(OMAP44XX_I2C2_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_i2c3(void *pdata)
+{
+	return omap_add_i2c(OMAP44XX_I2C3_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_i2c4(void *pdata)
+{
+	return omap_add_i2c(OMAP44XX_I2C4_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_mmc1(void *pdata)
+{
+	return omap_add_mmc(OMAP44XX_MMC1_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_mmc2(void *pdata)
+{
+	return omap_add_mmc(OMAP44XX_MMC2_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_mmc3(void *pdata)
+{
+	return omap_add_mmc(OMAP44XX_MMC3_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_mmc4(void *pdata)
+{
+	return omap_add_mmc(OMAP44XX_MMC4_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_mmc5(void *pdata)
+{
+	return omap_add_mmc(OMAP44XX_MMC5_BASE, pdata);
+}
+
+static inline struct device_d *omap4_add_ehci(void *pdata)
+{
+	return add_usb_ehci_device(DEVICE_ID_DYNAMIC, OMAP44XX_EHCI_BASE,
+					OMAP44XX_EHCI_BASE + 0x10, pdata);
+}
+
-- 
1.7.0.4


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

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

* [PATCH 5/7] ARM OMAP: Use wrapper in board files
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
                   ` (3 preceding siblings ...)
  2012-12-18 14:13 ` [PATCH 4/7] ARM OMAP: Create device file Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 14:13 ` [PATCH 6/7] ARM AM33XX: Add mmc0 pin mux function Teresa Gámez
  2012-12-18 14:13 ` [PATCH 7/7] pcm051: Add inital support Teresa Gámez
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox

Use the omap wrappers in board files instead of the add_generic_device().
Compile Tested every board.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/archosg9/board.c          |   19 ++++++-------------
 arch/arm/boards/beagle/board.c            |   20 ++++++--------------
 arch/arm/boards/beaglebone/board.c        |   17 ++++-------------
 arch/arm/boards/omap343xdsp/board.c       |   12 ++++--------
 arch/arm/boards/omap3evm/board.c          |   20 +++++---------------
 arch/arm/boards/panda/board.c             |   22 ++++++----------------
 arch/arm/boards/pcm049/board.c            |   21 +++++++--------------
 arch/arm/boards/phycard-a-l1/pca-a-l1.c   |   20 +++++---------------
 arch/arm/boards/phycard-a-xl2/pca-a-xl2.c |   21 +++++++--------------
 9 files changed, 50 insertions(+), 122 deletions(-)

diff --git a/arch/arm/boards/archosg9/board.c b/arch/arm/boards/archosg9/board.c
index dab0a36..57cfc4f 100644
--- a/arch/arm/boards/archosg9/board.c
+++ b/arch/arm/boards/archosg9/board.c
@@ -15,15 +15,12 @@
 #include <ns16550.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/omap4-devices.h>
 #include <mach/omap4-silicon.h>
 #include <sizes.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000, /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
 static int archosg9_console_init(void){
 	if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT))
 		add_generic_device("serial_omap4_usbboot", DEVICE_ID_DYNAMIC
@@ -31,15 +28,14 @@ static int archosg9_console_init(void){
 	if (IS_ENABLED(CONFIG_DRIVER_SERIAL_NS16550)) {
 		gpio_direction_output(41, 0); /* gps_disable */
 		gpio_direction_output(34, 1); /* 1v8_pwron */
-		add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART1_BASE, 1024,
-			IORESOURCE_MEM_8BIT, &serial_plat);
+		omap4_add_ns16550_uart1();
 	}
 	return 0;
 }
 console_initcall(archosg9_console_init);
 
 static int archosg9_mem_init(void){
-	arm_add_mem_device("ram0", 0x80000000, SZ_1G);
+	omap_add_ram0(SZ_1G);
 	return 0;
 }
 mem_initcall(archosg9_mem_init);
@@ -50,12 +46,9 @@ static struct i2c_board_info i2c_devices[] = {
 
 static int archosg9_devices_init(void){
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	add_generic_device("i2c-omap"  , DEVICE_ID_DYNAMIC, NULL,
-		OMAP44XX_I2C1_BASE, 0x100, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL,
-		OMAP44XX_MMC1_BASE, SZ_4K, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL,
-		OMAP44XX_MMC2_BASE, SZ_4K, IORESOURCE_MEM, NULL);
+	omap4_add_i2c1(NULL);
+	omap4_add_mmc1(NULL);
+	omap4_add_mmc2(NULL);
 
 	armlinux_set_bootparams((void *)0x80000100);
 	/*
diff --git a/arch/arm/boards/beagle/board.c b/arch/arm/boards/beagle/board.c
index f6d9d3f..897de48 100644
--- a/arch/arm/boards/beagle/board.c
+++ b/arch/arm/boards/beagle/board.c
@@ -60,6 +60,7 @@
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
 #include <mach/control.h>
+#include <mach/omap3-devices.h>
 #include <mach/omap3-mux.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
@@ -234,11 +235,6 @@ pure_initcall(beagle_board_init);
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,      /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 /**
  * @brief UART serial port initialization - remember to enable COM clocks in
  * arch
@@ -248,8 +244,7 @@ static struct NS16550_plat serial_plat = {
 static int beagle_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
-			   &serial_plat);
+	omap3_add_ns16550_uart3();
 
 	return 0;
 }
@@ -286,7 +281,7 @@ static struct gpmc_nand_platform_data nand_plat = {
 
 static int beagle_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, 128 * 1024 * 1024);
+	omap_add_ram0(SZ_128M);
 
 	return 0;
 }
@@ -295,13 +290,11 @@ mem_initcall(beagle_mem_init);
 static int beagle_devices_init(void)
 {
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, NULL, OMAP_I2C1_BASE, SZ_4K,
-			   IORESOURCE_MEM, NULL);
+	omap3_add_i2c1(NULL);
 
 #ifdef CONFIG_USB_EHCI_OMAP
 	if (ehci_omap_init(&omap_ehci_pdata) >= 0)
-		add_usb_ehci_device(DEVICE_ID_DYNAMIC, OMAP_EHCI_BASE,
-				    OMAP_EHCI_BASE + 0x10, &ehci_pdata);
+		omap3_add_ehci(&ehci_pdata);
 #endif /* CONFIG_USB_EHCI_OMAP */
 #ifdef CONFIG_OMAP_GPMC
 	/* WP is made high and WAIT1 active Low */
@@ -309,8 +302,7 @@ static int beagle_devices_init(void)
 #endif
 	omap_add_gpmc_nand_device(&nand_plat);
 
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, OMAP_MMC1_BASE, SZ_4K,
-			   IORESOURCE_MEM, NULL);
+	omap3_add_mmc1(NULL);
 
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_OMAP3_BEAGLE);
diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index fd30dd9..5215ec2 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -33,6 +33,7 @@
 #include <ns16550.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/am33xx-devices.h>
 #include <mach/am33xx-silicon.h>
 #include <mach/am33xx-clock.h>
 #include <mach/sdrc.h>
@@ -288,11 +289,6 @@ pure_initcall(beaglebone_board_init);
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,      /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 /**
  * @brief UART serial port initialization - remember to enable COM clocks in
  * arch
@@ -302,9 +298,7 @@ static struct NS16550_plat serial_plat = {
 static int beaglebone_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(-1, AM33XX_UART0_BASE, SZ_1K, IORESOURCE_MEM_8BIT,
-			   &serial_plat);
-
+	am33xx_add_ns16550_uart0();
 	return 0;
 }
 console_initcall(beaglebone_console_init);
@@ -312,7 +306,7 @@ console_initcall(beaglebone_console_init);
 
 static int beaglebone_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, 256 * 1024 * 1024);
+	omap_add_ram0(256 * 1024 * 1024);
 
 	return 0;
 }
@@ -320,10 +314,7 @@ mem_initcall(beaglebone_mem_init);
 
 static int beaglebone_devices_init(void)
 {
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL,
-	                   AM33XX_MMCHS0_BASE+0x100, SZ_4K,
-	                   IORESOURCE_MEM, NULL);
-
+	am33xx_add_mmc0(NULL);
 	enable_i2c0_pin_mux();
 
 	armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/omap343xdsp/board.c b/arch/arm/boards/omap343xdsp/board.c
index fc50eb1..3298d64 100644
--- a/arch/arm/boards/omap343xdsp/board.c
+++ b/arch/arm/boards/omap343xdsp/board.c
@@ -43,11 +43,13 @@
 
 #include <common.h>
 #include <console.h>
+#include <sizes.h>
 #include <init.h>
 #include <driver.h>
 #include <io.h>
 #include <ns16550.h>
 #include <asm/armlinux.h>
+#include <mach/omap3-devices.h>
 #include <mach/omap3-silicon.h>
 #include <mach/sdrc.h>
 #include <mach/sys_info.h>
@@ -603,11 +605,6 @@ static void mux_config(void)
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,	/* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 /**
  * @brief UART serial port initialization - remember to enable COM clocks in arch
  *
@@ -616,8 +613,7 @@ static struct NS16550_plat serial_plat = {
 static int sdp3430_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
-			   &serial_plat);
+	omap3_add_ns16550_uart3();
 
 	return 0;
 }
@@ -627,7 +623,7 @@ console_initcall(sdp3430_console_init);
 
 static int sdp3430_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, 128 * 1024 * 1024);
+	omap_add_ram0(SZ_128M);
 
 	return 0;
 }
diff --git a/arch/arm/boards/omap3evm/board.c b/arch/arm/boards/omap3evm/board.c
index a5faf56..f39c448 100644
--- a/arch/arm/boards/omap3evm/board.c
+++ b/arch/arm/boards/omap3evm/board.c
@@ -37,7 +37,6 @@
  *
  */
 
-
 #include <common.h>
 #include <console.h>
 #include <init.h>
@@ -46,6 +45,7 @@
 #include <sizes.h>
 #include <ns16550.h>
 #include <asm/armlinux.h>
+#include <mach/omap3-devices.h>
 #include <mach/omap3-silicon.h>
 #include <mach/sdrc.h>
 #include <mach/sys_info.h>
@@ -56,7 +56,6 @@
 #include <errno.h>
 #include <generated/mach-types.h>
 
-
 /*
  * Boot-time initialization(s)
  */
@@ -212,11 +211,6 @@ pure_initcall(omap3_evm_board_init);
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 
-static struct NS16550_plat serial_plat = {
-	.clock		= 48000000,      /* 48MHz (APLL96/2) */
-	.shift		= 2,
-};
-
 /**
  * @brief Initialize the serial port to be used as console.
  *
@@ -224,14 +218,11 @@ static struct NS16550_plat serial_plat = {
  */
 static int omap3evm_init_console(void)
 {
-	add_ns16550_device(DEVICE_ID_DYNAMIC,
 #if defined(CONFIG_OMAP3EVM_UART1)
-			OMAP_UART1_BASE,
+	omap3_add_ns16550_uart1();
 #elif defined(CONFIG_OMAP3EVM_UART3)
-			OMAP_UART3_BASE,
+	omap3_add_ns16550_uart3();
 #endif
-			1024, IORESOURCE_MEM_8BIT, &serial_plat);
-
 	return 0;
 }
 console_initcall(omap3evm_init_console);
@@ -239,7 +230,7 @@ console_initcall(omap3evm_init_console);
 
 static int omap3evm_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, 128 * 1024 * 1024);
+	omap_add_ram0(SZ_128M);
 
 	return 0;
 }
@@ -254,8 +245,7 @@ static int omap3evm_init_devices(void)
 	gpmc_generic_init(0x10);
 #endif
 #ifdef CONFIG_MCI_OMAP_HSMMC
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, OMAP_MMC1_BASE, SZ_4K,
-				IORESOURCE_MEM, NULL);
+	omap3_add_mmc1(NULL);
 #endif
         armlinux_set_bootparams((void *)0x80000100);
         armlinux_set_architecture(MACH_TYPE_OMAP3EVM);
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 99222d2..c89a3a0 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -19,6 +19,7 @@
 #include <asm/mmu.h>
 #include <mach/gpio.h>
 #include <environment.h>
+#include <mach/omap4-devices.h>
 #include <mach/xload.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
@@ -33,16 +34,10 @@ static int board_revision;
 #define GPIO_BOARD_ID1 101
 #define GPIO_BOARD_ID2 171
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,      /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 static int panda_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024,
-			IORESOURCE_MEM_8BIT, &serial_plat);
+	omap4_add_ns16550_uart3();
 
 	return 0;
 }
@@ -50,7 +45,7 @@ console_initcall(panda_console_init);
 
 static int panda_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, SZ_1G);
+	omap_add_ram0(SZ_1G);
 
 	return 0;
 }
@@ -92,8 +87,7 @@ static void panda_ehci_init(void)
 	/* enable power to hub */
 	gpio_set_value(GPIO_HUB_POWER, 1);
 
-	add_usb_ehci_device(DEVICE_ID_DYNAMIC, 0x4a064c00,
-			    0x4a064c00 + 0x10, &ehci_pdata);
+	omap4_add_ehci(&ehci_pdata);
 }
 #else
 static void panda_ehci_init(void)
@@ -160,13 +154,9 @@ static int panda_devices_init(void)
 	}
 
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC,
-				NULL, 0x48070000, 0x1000,
-				IORESOURCE_MEM, NULL);
-
+	omap4_add_i2c1(NULL);
 
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K,
-			   IORESOURCE_MEM, NULL);
+	omap4_add_mmc1(NULL);
 	panda_ehci_init();
 
 	panda_led_init();
diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index 859ce3b..045e259 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -32,22 +32,17 @@
 #include <partition.h>
 #include <nand.h>
 #include <asm/mmu.h>
+#include <mach/omap4-devices.h>
 #include <mach/gpio.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
 #include <mach/xload.h>
 #include <i2c/i2c.h>
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,      /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 static int pcm049_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024,
-			IORESOURCE_MEM_8BIT, &serial_plat);
+	omap4_add_ns16550_uart3();
 
 	return 0;
 }
@@ -55,10 +50,10 @@ console_initcall(pcm049_console_init);
 
 static int pcm049_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, SZ_512M);
+	omap_add_ram0(SZ_512M);
+
+	omap4_add_sram0();
 
-	add_mem_device("sram0", 0x40300000, 48 * 1024,
-				   IORESOURCE_MEM_WRITEABLE);
 	return 0;
 }
 mem_initcall(pcm049_mem_init);
@@ -99,11 +94,9 @@ static struct gpmc_nand_platform_data nand_plat = {
 static int pcm049_devices_init(void)
 {
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, NULL, 0x48070000, 0x1000,
-				IORESOURCE_MEM, NULL);
+	omap4_add_i2c1(NULL);
 
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K,
-			   IORESOURCE_MEM, NULL);
+	omap4_add_mmc1(NULL);
 
 	gpmc_generic_init(0x10);
 
diff --git a/arch/arm/boards/phycard-a-l1/pca-a-l1.c b/arch/arm/boards/phycard-a-l1/pca-a-l1.c
index c6a7e60..d69a501 100644
--- a/arch/arm/boards/phycard-a-l1/pca-a-l1.c
+++ b/arch/arm/boards/phycard-a-l1/pca-a-l1.c
@@ -52,6 +52,7 @@
 #include <generated/mach-types.h>
 #include <linux/err.h>
 #include <mach/control.h>
+#include <mach/omap3-devices.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
 #include <mach/omap_hsmmc.h>
@@ -304,14 +305,6 @@ static int pcaal1_board_init(void)
 }
 pure_initcall(pcaal1_board_init);
 
-/*
- * Run-time initialization(s)
- */
-static struct NS16550_plat serial_plat = {
-	.clock	= 48000000,      /* 48MHz (APLL96/2) */
-	.shift	= 2,
-};
-
 /**
  * @brief Initialize the serial port to be used as console.
  *
@@ -319,8 +312,7 @@ static struct NS16550_plat serial_plat = {
  */
 static int pcaal1_init_console(void)
 {
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
-			   &serial_plat);
+	omap3_add_ns16550_uart3();
 
 	return 0;
 }
@@ -362,10 +354,9 @@ static int pcaal1_mem_init(void)
 	 */
 	gpmc_generic_init(0x10);
 #endif
-	add_mem_device("sram0", OMAP_SRAM_BASE, 60 * SZ_1K,
-				   IORESOURCE_MEM_WRITEABLE);
+	omap3_add_sram0();
 
-	arm_add_mem_device("ram0", OMAP_SDRC_CS0, get_sdr_cs_size(SDRC_CS0_OSET));
+	omap_add_ram0(get_sdr_cs_size(SDRC_CS0_OSET));
 	printf("found %s at SDCS0\n", size_human_readable(get_sdr_cs_size(SDRC_CS0_OSET)));
 
 	if ((get_sdr_cs_size(SDRC_CS1_OSET) != 0) && (get_sdr_cs1_base() != OMAP_SDRC_CS0)) {
@@ -394,8 +385,7 @@ static int pcaal1_init_devices(void)
 	omap_add_gpmc_nand_device(&nand_plat);
 
 #ifdef CONFIG_MCI_OMAP_HSMMC
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, OMAP_MMC1_BASE, SZ_4K,
-			   IORESOURCE_MEM, &pcaal1_hsmmc_plat);
+	omap3_add_mmc1(&pcaal1_hsmmc_plat);
 #endif
 
 #ifdef CONFIG_DRIVER_NET_SMC911X
diff --git a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
index 26b31dd..2cf1ace 100644
--- a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
+++ b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
@@ -32,6 +32,7 @@
 #include <partition.h>
 #include <nand.h>
 #include <asm/mmu.h>
+#include <mach/omap4-devices.h>
 #include <mach/gpio.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
@@ -39,16 +40,10 @@
 #include <mach/omap_hsmmc.h>
 #include <i2c/i2c.h>
 
-static struct NS16550_plat serial_plat = {
-	.clock = 48000000,      /* 48MHz (APLL96/2) */
-	.shift = 2,
-};
-
 static int pcaaxl2_console_init(void)
 {
 	/* Register the serial port */
-	add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024,
-		IORESOURCE_MEM_8BIT, &serial_plat);
+	omap4_add_ns16550_uart3();
 
 	return 0;
 }
@@ -56,10 +51,10 @@ console_initcall(pcaaxl2_console_init);
 
 static int pcaaxl2_mem_init(void)
 {
-	arm_add_mem_device("ram0", 0x80000000, SZ_512M);
+	omap_add_ram0(SZ_512M);
+
+	omap4_add_sram0();
 
-	add_mem_device("sram0", 0x40300000, 48 * 1024,
-				   IORESOURCE_MEM_WRITEABLE);
 	return 0;
 }
 mem_initcall(pcaaxl2_mem_init);
@@ -111,16 +106,14 @@ static int pcaaxl2_devices_init(void)
 	u32 value;
 
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, NULL, 0x48070000, 0x1000,
-				IORESOURCE_MEM, NULL);
+	omap4_add_i2c1(NULL);
 
 	value = readl(OMAP4_CONTROL_PBIASLITE);
 	value &= ~OMAP4_MMC1_PBIASLITE_VMODE;
 	value |= (OMAP4_MMC1_PBIASLITE_PWRDNZ |	OMAP4_MMC1_PWRDNZ);
 	writel(value, OMAP4_CONTROL_PBIASLITE);
 
-	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K,
-			   IORESOURCE_MEM, &mmc_device);
+	omap4_add_mmc1(&mmc_device);
 
 	gpmc_generic_init(0x10);
 
-- 
1.7.0.4


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

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

* [PATCH 6/7] ARM AM33XX: Add mmc0 pin mux function
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
                   ` (4 preceding siblings ...)
  2012-12-18 14:13 ` [PATCH 5/7] ARM OMAP: Use wrapper in board files Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  2012-12-18 14:13 ` [PATCH 7/7] pcm051: Add inital support Teresa Gámez
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/am33xx_mux.c              |    5 +++++
 arch/arm/mach-omap/include/mach/am33xx-mux.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index 22bf317..3d7f245 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -504,3 +504,8 @@ void enable_uart0_pin_mux(void)
 {
 	configure_module_pin_mux(uart0_pin_mux);
 }
+
+void enable_mmc0_pin_mux(void)
+{
+	configure_module_pin_mux(mmc0_pin_mux);
+}
diff --git a/arch/arm/mach-omap/include/mach/am33xx-mux.h b/arch/arm/mach-omap/include/mach/am33xx-mux.h
index ed328f5..6078b3a 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-mux.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-mux.h
@@ -18,5 +18,6 @@ extern void enable_i2c0_pin_mux(void);
 extern void enable_i2c1_pin_mux(void);
 extern void enable_i2c2_pin_mux(void);
 extern void enable_uart0_pin_mux(void);
+extern void enable_mmc0_pin_mux(void);
 
 #endif /*__AM33XX_MUX_H__ */
-- 
1.7.0.4


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

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

* [PATCH 7/7] pcm051: Add inital support
  2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
                   ` (5 preceding siblings ...)
  2012-12-18 14:13 ` [PATCH 6/7] ARM AM33XX: Add mmc0 pin mux function Teresa Gámez
@ 2012-12-18 14:13 ` Teresa Gámez
  6 siblings, 0 replies; 9+ messages in thread
From: Teresa Gámez @ 2012-12-18 14:13 UTC (permalink / raw)
  To: barebox

Added initial support for Phytec phyCORE-AM335x.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/Makefile                  |    1 +
 arch/arm/boards/pcm051/Makefile    |    1 +
 arch/arm/boards/pcm051/board.c     |   64 ++++++++++++++++++++++++++++++++++++
 arch/arm/boards/pcm051/config.h    |   21 ++++++++++++
 arch/arm/boards/pcm051/env/boot/sd |   10 ++++++
 arch/arm/boards/pcm051/env/config  |   22 ++++++++++++
 arch/arm/configs/pcm051_defconfig  |   56 +++++++++++++++++++++++++++++++
 arch/arm/mach-omap/Kconfig         |   10 ++++++
 8 files changed, 185 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/pcm051/Makefile
 create mode 100644 arch/arm/boards/pcm051/board.c
 create mode 100644 arch/arm/boards/pcm051/config.h
 create mode 100644 arch/arm/boards/pcm051/env/boot/sd
 create mode 100644 arch/arm/boards/pcm051/env/config
 create mode 100644 arch/arm/configs/pcm051_defconfig

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 5082a13..487cc64 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -115,6 +115,7 @@ board-$(CONFIG_MACH_PCM027)			:= pcm027
 board-$(CONFIG_MACH_PCM037)			:= pcm037
 board-$(CONFIG_MACH_PCM038)			:= pcm038
 board-$(CONFIG_MACH_PCM043)			:= pcm043
+board-$(CONFIG_MACH_PCM051)			:= pcm051
 board-$(CONFIG_MACH_PM9261)			:= pm9261
 board-$(CONFIG_MACH_PM9263)			:= pm9263
 board-$(CONFIG_MACH_PM9G45)			:= pm9g45
diff --git a/arch/arm/boards/pcm051/Makefile b/arch/arm/boards/pcm051/Makefile
new file mode 100644
index 0000000..dcfc293
--- /dev/null
+++ b/arch/arm/boards/pcm051/Makefile
@@ -0,0 +1 @@
+obj-y += board.o
diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
new file mode 100644
index 0000000..ad76dc5
--- /dev/null
+++ b/arch/arm/boards/pcm051/board.c
@@ -0,0 +1,64 @@
+/*
+ * pcm051 - phyCORE-AM335x Board Initalization Code
+ *
+ * Copyright (C) 2012 Teresa Gámez, Phytec Messtechnik GmbH
+ *
+ * Based on arch/arm/boards/omap/board-beagle.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <init.h>
+#include <sizes.h>
+#include <ns16550.h>
+#include <asm/armlinux.h>
+#include <generated/mach-types.h>
+#include <mach/am33xx-devices.h>
+#include <mach/am33xx-mux.h>
+#include <mach/am33xx-silicon.h>
+
+/**
+ * @brief UART serial port initialization
+ * arch
+ *
+ * @return result of device registration
+ */
+static int pcm051_console_init(void)
+{
+	/* Register the serial port */
+	am33xx_add_ns16550_uart0();
+
+	return 0;
+}
+console_initcall(pcm051_console_init);
+
+static int pcm051_mem_init(void)
+{
+	omap_add_ram0(SZ_512M);
+
+	return 0;
+}
+mem_initcall(pcm051_mem_init);
+
+static int pcm051_devices_init(void)
+{
+	enable_mmc0_pin_mux();
+
+	am33xx_add_mmc0(NULL);
+
+	armlinux_set_bootparams((void *)(AM33XX_DRAM_ADDR_SPACE_START + 0x100));
+	armlinux_set_architecture(MACH_TYPE_PCM051);
+
+	return 0;
+}
+device_initcall(pcm051_devices_init);
diff --git a/arch/arm/boards/pcm051/config.h b/arch/arm/boards/pcm051/config.h
new file mode 100644
index 0000000..8b2b876
--- /dev/null
+++ b/arch/arm/boards/pcm051/config.h
@@ -0,0 +1,21 @@
+/**
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
diff --git a/arch/arm/boards/pcm051/env/boot/sd b/arch/arm/boards/pcm051/env/boot/sd
new file mode 100644
index 0000000..f303c10
--- /dev/null
+++ b/arch/arm/boards/pcm051/env/boot/sd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "kernel & rootfs on SD card"
+	exit
+fi
+
+global.bootm.image=/boot/uImage
+global.bootm.oftree=/boot/oftree
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/pcm051/env/config b/arch/arm/boards/pcm051/env/config
new file mode 100644
index 0000000..dd35ff4
--- /dev/null
+++ b/arch/arm/boards/pcm051/env/config
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# change network settings in /env/network/eth0
+# change mtd partition settings and automountpoints in /env/init/*
+
+global.hostname=pcm051
+
+# set to false if you do not want to have colors
+global.allow_color=true
+
+# user (used for network filenames)
+global.user=none
+
+# timeout in seconds before the default boot entry is started
+global.autoboot_timeout=3
+
+# default boot entry (one of /env/boot/*)
+global.boot.default=sd
+
+# base bootargs
+global.linux.bootargs.base="console=ttyO0,115200n8"
+
diff --git a/arch/arm/configs/pcm051_defconfig b/arch/arm/configs/pcm051_defconfig
new file mode 100644
index 0000000..4da0ed4
--- /dev/null
+++ b/arch/arm/configs/pcm051_defconfig
@@ -0,0 +1,56 @@
+CONFIG_ARCH_OMAP=y
+CONFIG_ARCH_AM33XX=y
+CONFIG_OMAP_BUILD_IFT=y
+CONFIG_MACH_PCM051=y
+CONFIG_AEABI=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_ARM_UNWIND=y
+CONFIG_TEXT_BASE=0x81000000
+CONFIG_PROMPT="barebox@pcm051>"
+CONFIG_LONGHELP=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+# CONFIG_TIMESTAMP is not set
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/pcm051/env"
+CONFIG_DEBUG_INFO=y
+CONFIG_ENABLE_FLASH_NOISE=y
+CONFIG_ENABLE_PARTITION_NOISE=y
+CONFIG_ENABLE_DEVICE_NOISE=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_MD5SUM=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_BOOTM_SHOW_TYPE=y
+CONFIG_CMD_UIMAGE=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_GO=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_DRIVER_SERIAL_NS16550=y
+CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
+# CONFIG_SPI is not set
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_USB=y
+CONFIG_MCI=y
+CONFIG_MCI_STARTUP=y
+CONFIG_MCI_OMAP_HSMMC=y
+CONFIG_FS_FAT=y
+CONFIG_FS_FAT_WRITE=y
+CONFIG_FS_FAT_LFN=y
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index ae1e07e..c5bb3a3 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -112,6 +112,7 @@ config BOARDINFO
 	default "Phytec phyCORE pcm049" if MACH_PCM049
 	default "Phytec phyCARD-A-L1" if MACH_PCAAL1
 	default "Phytec phyCARD-A-XL2" if MACH_PCAAXL2
+	default "Phytec phyCORE-AM335x" if MACH_PCM051
 
 choice
 	prompt "Select OMAP board"
@@ -186,6 +187,15 @@ config MACH_PCAAXL2
 	help
 	  Say Y here if you are using a phyCARD-A-XL1 PCA-A-XL1
 
+config MACH_PCM051
+	bool "Phytec phyCORE pcm051"
+	select OMAP_CLOCK_ALL
+	select HAVE_NOSHELL
+	select HAVE_DEFAULT_ENVIRONMENT_NEW
+	depends on ARCH_AM33XX
+	help
+	  Say Y here if you are using Phytecs phyCORE pcm051 board
+
 endchoice
 
 if MACH_OMAP3EVM
-- 
1.7.0.4


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

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

* Re: [PATCH 4/7] ARM OMAP: Create device file
  2012-12-18 14:13 ` [PATCH 4/7] ARM OMAP: Create device file Teresa Gámez
@ 2012-12-18 17:29   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-12-18 17:29 UTC (permalink / raw)
  To: Teresa Gámez; +Cc: barebox

On 15:13 Tue 18 Dec     , Teresa Gámez wrote:
> Created wrapper to add omap devices.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
>  arch/arm/mach-omap/Makefile                      |    4 +-
>  arch/arm/mach-omap/devices.c                     |   69 +++++++++++++++++++
>  arch/arm/mach-omap/include/mach/am33xx-devices.h |   36 ++++++++++
>  arch/arm/mach-omap/include/mach/devices.h        |   27 ++++++++
>  arch/arm/mach-omap/include/mach/omap3-devices.h  |   60 ++++++++++++++++-
>  arch/arm/mach-omap/include/mach/omap4-devices.h  |   77 ++++++++++++++++++++++
>  6 files changed, 269 insertions(+), 4 deletions(-)
>  create mode 100644 arch/arm/mach-omap/devices.c
>  create mode 100644 arch/arm/mach-omap/include/mach/am33xx-devices.h
>  create mode 100644 arch/arm/mach-omap/include/mach/devices.h
>  create mode 100644 arch/arm/mach-omap/include/mach/omap4-devices.h
> 
> diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
> index 1536744..494da4e 100644
> --- a/arch/arm/mach-omap/Makefile
> +++ b/arch/arm/mach-omap/Makefile
> @@ -15,8 +15,8 @@
>  # GNU General Public License for more details.
>  #
>  #
> -obj-$(CONFIG_ARCH_OMAP) += syslib.o
> -pbl-$(CONFIG_ARCH_OMAP) += syslib.o
> +obj-$(CONFIG_ARCH_OMAP) += syslib.o devices.o
> +pbl-$(CONFIG_ARCH_OMAP) += syslib.o devices.o
why in the pbl?

the pbl does not need ot add devices

Best Regards,
J.

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

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

end of thread, other threads:[~2012-12-18 17:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-18 14:13 [PATCH 0/7] Adding pcm051 support Teresa Gámez
2012-12-18 14:13 ` [PATCH 1/7] ARM OMAP4: Add SRAM base define Teresa Gámez
2012-12-18 14:13 ` [PATCH 2/7] ARM OMAP4: Add EHCI " Teresa Gámez
2012-12-18 14:13 ` [PATCH 3/7] ARM AM33XX: Add MMC Bases Teresa Gámez
2012-12-18 14:13 ` [PATCH 4/7] ARM OMAP: Create device file Teresa Gámez
2012-12-18 17:29   ` Jean-Christophe PLAGNIOL-VILLARD
2012-12-18 14:13 ` [PATCH 5/7] ARM OMAP: Use wrapper in board files Teresa Gámez
2012-12-18 14:13 ` [PATCH 6/7] ARM AM33XX: Add mmc0 pin mux function Teresa Gámez
2012-12-18 14:13 ` [PATCH 7/7] pcm051: Add inital support Teresa Gámez

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