summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-samsung
diff options
context:
space:
mode:
authorJuergen Beisert <jbe@pengutronix.de>2012-07-13 20:46:19 +0200
committerJuergen Beisert <jbe@pengutronix.de>2012-07-20 08:41:34 +0200
commit0d22e37ff8f28f87600da7d9692b56db622ed956 (patch)
treed6bcfde15838a4728ffbd6170353e7ed3c06c929 /arch/arm/mach-samsung
parentc0cf41f958064d86a3ac40cfb74657232838d6c7 (diff)
downloadbarebox-0d22e37ff8f28f87600da7d9692b56db622ed956.tar.gz
barebox-0d22e37ff8f28f87600da7d9692b56db622ed956.tar.xz
ARM/Samsung: unify device registration for the S3C24XX SoCs
Barebox crashes since it has trouble with a resource size of 0. Most of the S3C24XX based platforms crashes at runtime and can't use devices with resource sizes of 0 anymore. This patch fix it by unifying the device registration for all current Barebox's S3C24XX based platforms. - A9M2410 and A9M2440 compile time tested only. - Mini2440 also runtime tested. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-samsung')
-rw-r--r--arch/arm/mach-samsung/include/mach/devices-s3c24xx.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mach-samsung/include/mach/devices-s3c24xx.h b/arch/arm/mach-samsung/include/mach/devices-s3c24xx.h
new file mode 100644
index 0000000000..51fd9a1825
--- /dev/null
+++ b/arch/arm/mach-samsung/include/mach/devices-s3c24xx.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Juergen Beisert
+ *
+ * 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 INCLUDE_MACH_DEVICES_S3C24XX_H
+# define INCLUDE_MACH_DEVICES_S3C24XX_H
+
+#include <driver.h>
+#include <mach/s3c24xx-iomap.h>
+#include <mach/s3c24xx-nand.h>
+#include <mach/s3c-mci.h>
+#include <mach/s3c24xx-fb.h>
+
+static inline void s3c24xx_add_nand(struct s3c24x0_nand_platform_data *d)
+{
+ add_generic_device("s3c24x0_nand", DEVICE_ID_DYNAMIC, NULL,
+ S3C24X0_NAND_BASE, 0x80, IORESOURCE_MEM, d);
+}
+
+static inline void s3c24xx_add_mci(struct s3c_mci_platform_data *d)
+{
+ add_generic_device("s3c_mci", DEVICE_ID_DYNAMIC, NULL,
+ S3C2410_SDI_BASE, 0x80, IORESOURCE_MEM, d);
+}
+
+static inline void s3c24xx_add_fb(struct s3c_fb_platform_data *d)
+{
+ add_generic_device("s3c_fb", DEVICE_ID_DYNAMIC, NULL,
+ S3C2410_LCD_BASE, 0x80, IORESOURCE_MEM, d);
+}
+
+static inline void s3c24xx_add_ohci(void)
+{
+ add_generic_device("ohci", DEVICE_ID_DYNAMIC, NULL,
+ S3C2410_USB_HOST_BASE, 0x100, IORESOURCE_MEM, NULL);
+}
+
+static inline void s3c24xx_add_uart1(void)
+{
+ add_generic_device("s3c_serial", DEVICE_ID_DYNAMIC, NULL, S3C_UART1_BASE,
+ S3C_UART1_SIZE, IORESOURCE_MEM, NULL);
+}
+
+#endif /* INCLUDE_MACH_DEVICES_S3C24XX_H */