aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-25 18:17:11 -0500
committerTony Lindgren <tony@atomide.com>2013-11-25 18:31:17 -0500
commit5a87cde490e1a1a5be5200012bf37a4b25b0f70e (patch)
tree4f6276801085ad113d04aa5bc851ca34e0079459 /arch/arm/mach-omap2
parentfa590c923401368d86db361350849a7bf9f42b8a (diff)
ARM: OMAP2+: Remove legacy booting support for n8x0
Now we can boot n8x with the appended device tree with: $ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- make omap2420-n800.dtb $ cat arch/arm/boot/zImage arch/arm/boot/dts/omap2420-n800.dtb > /tmp/zImage Note that you need at least the following enabled: CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ATAG_DTB_COMPAT=y CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y CONFIG_PINCTRL=y CONFIG_PINCTRL_SINGLE=y Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c158
-rw-r--r--arch/arm/mach-omap2/msdi.c69
2 files changed, 0 insertions, 227 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 99dd184f50f1..d596571d7750 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -21,7 +21,6 @@
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/usb/musb.h> 23#include <linux/usb/musb.h>
24#include <linux/platform_data/i2c-cbus-gpio.h>
25#include <linux/platform_data/spi-omap2-mcspi.h> 24#include <linux/platform_data/spi-omap2-mcspi.h>
26#include <linux/platform_data/mtd-onenand-omap2.h> 25#include <linux/platform_data/mtd-onenand-omap2.h>
27#include <linux/mfd/menelaus.h> 26#include <linux/mfd/menelaus.h>
@@ -33,7 +32,6 @@
33#include "common.h" 32#include "common.h"
34#include "mmc.h" 33#include "mmc.h"
35#include "soc.h" 34#include "soc.h"
36#include "mux.h"
37#include "gpmc-onenand.h" 35#include "gpmc-onenand.h"
38 36
39#define TUSB6010_ASYNC_CS 1 37#define TUSB6010_ASYNC_CS 1
@@ -61,58 +59,12 @@ static void board_check_revision(void)
61 board_caps = NOKIA_N810; 59 board_caps = NOKIA_N810;
62 else if (of_machine_is_compatible("nokia,n810-wimax")) 60 else if (of_machine_is_compatible("nokia,n810-wimax"))
63 board_caps = NOKIA_N810_WIMAX; 61 board_caps = NOKIA_N810_WIMAX;
64 } else {
65 if (machine_is_nokia_n800())
66 board_caps = NOKIA_N800;
67 else if (machine_is_nokia_n810())
68 board_caps = NOKIA_N810;
69 else if (machine_is_nokia_n810_wimax())
70 board_caps = NOKIA_N810_WIMAX;
71 } 62 }
72 63
73 if (!board_caps) 64 if (!board_caps)
74 pr_err("Unknown board\n"); 65 pr_err("Unknown board\n");
75} 66}
76 67
77#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE)
78static struct i2c_cbus_platform_data n8x0_cbus_data = {
79 .clk_gpio = 66,
80 .dat_gpio = 65,
81 .sel_gpio = 64,
82};
83
84static struct platform_device n8x0_cbus_device = {
85 .name = "i2c-cbus-gpio",
86 .id = 3,
87 .dev = {
88 .platform_data = &n8x0_cbus_data,
89 },
90};
91
92static struct i2c_board_info n8x0_i2c_board_info_3[] __initdata = {
93 {
94 I2C_BOARD_INFO("retu-mfd", 0x01),
95 },
96};
97
98static void __init n8x0_cbus_init(void)
99{
100 const int retu_irq_gpio = 108;
101
102 if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ"))
103 return;
104 irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING);
105 n8x0_i2c_board_info_3[0].irq = gpio_to_irq(retu_irq_gpio);
106 i2c_register_board_info(3, n8x0_i2c_board_info_3,
107 ARRAY_SIZE(n8x0_i2c_board_info_3));
108 platform_device_register(&n8x0_cbus_device);
109}
110#else /* CONFIG_I2C_CBUS_GPIO */
111static void __init n8x0_cbus_init(void)
112{
113}
114#endif /* CONFIG_I2C_CBUS_GPIO */
115
116#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE) 68#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
117/* 69/*
118 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and 70 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
@@ -598,8 +550,6 @@ static void __init n8x0_mmc_init(void)
598 550
599 mmc1_data.nr_slots = 2; 551 mmc1_data.nr_slots = 2;
600 mmc_data[0] = &mmc1_data; 552 mmc_data[0] = &mmc1_data;
601 if (!of_have_populated_dt())
602 omap242x_init_mmc(mmc_data);
603} 553}
604#else 554#else
605static struct omap_mmc_platform_data mmc1_data; 555static struct omap_mmc_platform_data mmc1_data;
@@ -684,54 +634,6 @@ static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
684 }, 634 },
685}; 635};
686 636
687#ifdef CONFIG_OMAP_MUX
688static struct omap_board_mux board_mux[] __initdata = {
689 /* I2S codec port pins for McBSP block */
690 OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
691 OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
692 OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
693 OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
694 { .reg_offset = OMAP_MUX_TERMINATOR },
695};
696
697static struct omap_device_pad serial2_pads[] __initdata = {
698 {
699 .name = "uart3_rx_irrx.uart3_rx_irrx",
700 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
701 .enable = OMAP_MUX_MODE0,
702 .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */
703 },
704};
705
706static inline void board_serial_init(void)
707{
708 struct omap_board_data bdata;
709
710 bdata.flags = 0;
711 bdata.pads = NULL;
712 bdata.pads_cnt = 0;
713
714 bdata.id = 0;
715 omap_serial_init_port(&bdata, NULL);
716
717 bdata.id = 1;
718 omap_serial_init_port(&bdata, NULL);
719
720 bdata.id = 2;
721 bdata.pads = serial2_pads;
722 bdata.pads_cnt = ARRAY_SIZE(serial2_pads);
723 omap_serial_init_port(&bdata, NULL);
724}
725
726#else
727
728static inline void board_serial_init(void)
729{
730 omap_serial_init();
731}
732
733#endif
734
735static int __init n8x0_late_initcall(void) 637static int __init n8x0_late_initcall(void)
736{ 638{
737 if (!board_caps) 639 if (!board_caps)
@@ -740,8 +642,6 @@ static int __init n8x0_late_initcall(void)
740 gpmc_onenand_init(board_onenand_data); 642 gpmc_onenand_init(board_onenand_data);
741 n8x0_mmc_init(); 643 n8x0_mmc_init();
742 n8x0_usb_init(); 644 n8x0_usb_init();
743 if (!of_have_populated_dt())
744 n8x0_cbus_init();
745 645
746 return 0; 646 return 0;
747} 647}
@@ -764,61 +664,3 @@ void * __init n8x0_legacy_init(void)
764 664
765 return &mmc1_data; 665 return &mmc1_data;
766} 666}
767
768static void __init n8x0_init_machine(void)
769{
770 board_check_revision();
771 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
772 /* FIXME: add n810 spi devices */
773 spi_register_board_info(n800_spi_board_info,
774 ARRAY_SIZE(n800_spi_board_info));
775 omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
776 ARRAY_SIZE(n8x0_i2c_board_info_1));
777 omap_register_i2c_bus(2, 400, NULL, 0);
778 if (board_is_n810())
779 i2c_register_board_info(2, n810_i2c_board_info_2,
780 ARRAY_SIZE(n810_i2c_board_info_2));
781 if (!of_have_populated_dt()) {
782 board_serial_init();
783 omap_sdrc_init(NULL, NULL);
784 }
785}
786
787MACHINE_START(NOKIA_N800, "Nokia N800")
788 .atag_offset = 0x100,
789 .reserve = omap_reserve,
790 .map_io = omap242x_map_io,
791 .init_early = omap2420_init_early,
792 .init_irq = omap2_init_irq,
793 .handle_irq = omap2_intc_handle_irq,
794 .init_machine = n8x0_init_machine,
795 .init_late = omap2420_init_late,
796 .init_time = omap2_sync32k_timer_init,
797 .restart = omap2xxx_restart,
798MACHINE_END
799
800MACHINE_START(NOKIA_N810, "Nokia N810")
801 .atag_offset = 0x100,
802 .reserve = omap_reserve,
803 .map_io = omap242x_map_io,
804 .init_early = omap2420_init_early,
805 .init_irq = omap2_init_irq,
806 .handle_irq = omap2_intc_handle_irq,
807 .init_machine = n8x0_init_machine,
808 .init_late = omap2420_init_late,
809 .init_time = omap2_sync32k_timer_init,
810 .restart = omap2xxx_restart,
811MACHINE_END
812
813MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
814 .atag_offset = 0x100,
815 .reserve = omap_reserve,
816 .map_io = omap242x_map_io,
817 .init_early = omap2420_init_early,
818 .init_irq = omap2_init_irq,
819 .handle_irq = omap2_intc_handle_irq,
820 .init_machine = n8x0_init_machine,
821 .init_late = omap2420_init_late,
822 .init_time = omap2_sync32k_timer_init,
823 .restart = omap2xxx_restart,
824MACHINE_END
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c
index c52d8b4a3e91..828e0db3d943 100644
--- a/arch/arm/mach-omap2/msdi.c
+++ b/arch/arm/mach-omap2/msdi.c
@@ -88,72 +88,3 @@ int omap_msdi_reset(struct omap_hwmod *oh)
88 88
89 return 0; 89 return 0;
90} 90}
91
92#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
93
94static inline void omap242x_mmc_mux(struct omap_mmc_platform_data
95 *mmc_controller)
96{
97 if ((mmc_controller->slots[0].switch_pin > 0) && \
98 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
99 omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
100 OMAP_PIN_INPUT_PULLUP);
101 if ((mmc_controller->slots[0].gpio_wp > 0) && \
102 (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
103 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
104 OMAP_PIN_INPUT_PULLUP);
105
106 omap_mux_init_signal("sdmmc_cmd", 0);
107 omap_mux_init_signal("sdmmc_clki", 0);
108 omap_mux_init_signal("sdmmc_clko", 0);
109 omap_mux_init_signal("sdmmc_dat0", 0);
110 omap_mux_init_signal("sdmmc_dat_dir0", 0);
111 omap_mux_init_signal("sdmmc_cmd_dir", 0);
112 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) {
113 omap_mux_init_signal("sdmmc_dat1", 0);
114 omap_mux_init_signal("sdmmc_dat2", 0);
115 omap_mux_init_signal("sdmmc_dat3", 0);
116 omap_mux_init_signal("sdmmc_dat_dir1", 0);
117 omap_mux_init_signal("sdmmc_dat_dir2", 0);
118 omap_mux_init_signal("sdmmc_dat_dir3", 0);
119 }
120
121 /*
122 * Use internal loop-back in MMC/SDIO Module Input Clock
123 * selection
124 */
125 if (mmc_controller->slots[0].internal_clock) {
126 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
127 v |= (1 << 24);
128 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
129 }
130}
131
132void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
133{
134 struct platform_device *pdev;
135 struct omap_hwmod *oh;
136 int id = 0;
137 char *oh_name = "msdi1";
138 char *dev_name = "mmci-omap";
139
140 if (!mmc_data[0]) {
141 pr_err("%s fails: Incomplete platform data\n", __func__);
142 return;
143 }
144
145 omap242x_mmc_mux(mmc_data[0]);
146
147 oh = omap_hwmod_lookup(oh_name);
148 if (!oh) {
149 pr_err("Could not look up %s\n", oh_name);
150 return;
151 }
152 pdev = omap_device_build(dev_name, id, oh, mmc_data[0],
153 sizeof(struct omap_mmc_platform_data));
154 if (IS_ERR(pdev))
155 WARN(1, "Can'd build omap_device for %s:%s.\n",
156 dev_name, oh->name);
157}
158
159#endif