summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank/devices.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-02-13 11:06:42 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-14 13:09:09 +0100
commitf6b23059c9be5cfb4731d03ee150e89058f10b60 (patch)
tree90e48a010663fb00acdfe7b9a7c91088b19044fb /arch/arm/mach-highbank/devices.c
parent59cfe5905b9b45decffbb77a272e86b9b7d1e667 (diff)
downloadbarebox-f6b23059c9be5cfb4731d03ee150e89058f10b60.tar.gz
barebox-f6b23059c9be5cfb4731d03ee150e89058f10b60.tar.xz
arm: add highbank support
currently only tested under qemu qemu-system-arm -M highbank -nographic -m 4089 -kernel build/highbank/arch/arm/pbl/zbarebox -tftp "." -drive id=disk,if=ide,file=disk.img -device ide-drive,drive=disk,bus=ide.0 with: - timer (AMBA SP804) - uart (AMBA PL011) - gpio (AMBA PL061) - ahci - net (XGMAC) Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-highbank/devices.c')
-rw-r--r--arch/arm/mach-highbank/devices.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/mach-highbank/devices.c b/arch/arm/mach-highbank/devices.c
new file mode 100644
index 0000000000..6d75864306
--- /dev/null
+++ b/arch/arm/mach-highbank/devices.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <sizes.h>
+
+#include <linux/amba/bus.h>
+
+#include <asm/memory.h>
+
+#include <mach/devices.h>
+
+void highbank_add_ddram(u32 size)
+{
+ arm_add_mem_device("ram1", 0x00000000, size);
+ add_mem_device("nvram", 0xfff88000, SZ_32K, IORESOURCE_MEM_WRITEABLE);
+}
+
+void highbank_register_uart(void)
+{
+ amba_apb_device_add(NULL, "uart-pl011", DEVICE_ID_SINGLE, 0xfff36000, 4096, NULL, 0);
+}
+
+void highbank_register_ahci(void)
+{
+ add_generic_device("ahci", DEVICE_ID_SINGLE, NULL, 0xffe08000,
+ 0x10000, IORESOURCE_MEM, NULL);
+}
+
+void highbank_register_xgmac(unsigned id)
+{
+ resource_size_t start;
+
+ switch (id) {
+ case 0:
+ start = 0xfff50000;
+ break;
+ case 1:
+ start = 0xfff51000;
+ break;
+ default:
+ return;
+ }
+
+ add_generic_device("hb-xgmac", id, NULL, start, 0x1000,
+ IORESOURCE_MEM, NULL);
+}
+
+void highbank_register_gpio(unsigned id)
+{
+ resource_size_t start;
+
+ switch (id) {
+ case 0:
+ start = 0xfff30000;
+ break;
+ case 1:
+ start = 0xfff31000;
+ break;
+ case 2:
+ start = 0xfff32000;
+ break;
+ case 3:
+ start = 0xfff33000;
+ break;
+ default:
+ return;
+ }
+
+ amba_apb_device_add(NULL, "pl061_gpio", id, start, 0x1000, NULL, 0);
+}