aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c222
1 files changed, 79 insertions, 143 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 416d436111f2..d453522edb0d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -1,6 +1,5 @@
1
2/* 1/*
3 * Copyright (C) 2008-2009 ST-Ericsson 2 * Copyright (C) 2008-2012 ST-Ericsson
4 * 3 *
5 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> 4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
6 * 5 *
@@ -16,6 +15,7 @@
16#include <linux/io.h> 15#include <linux/io.h>
17#include <linux/i2c.h> 16#include <linux/i2c.h>
18#include <linux/platform_data/i2c-nomadik.h> 17#include <linux/platform_data/i2c-nomadik.h>
18#include <linux/platform_data/db8500_thermal.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/amba/bus.h> 20#include <linux/amba/bus.h>
21#include <linux/amba/pl022.h> 21#include <linux/amba/pl022.h>
@@ -33,18 +33,15 @@
33#include <linux/smsc911x.h> 33#include <linux/smsc911x.h>
34#include <linux/gpio_keys.h> 34#include <linux/gpio_keys.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/of.h>
37#include <linux/of_platform.h>
38#include <linux/leds.h> 36#include <linux/leds.h>
39#include <linux/pinctrl/consumer.h> 37#include <linux/pinctrl/consumer.h>
38#include <linux/platform_data/pinctrl-nomadik.h>
39#include <linux/platform_data/dma-ste-dma40.h>
40 40
41#include <asm/mach-types.h> 41#include <asm/mach-types.h>
42#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
43#include <asm/hardware/gic.h> 43#include <asm/hardware/gic.h>
44 44
45#include <plat/ste_dma40.h>
46#include <plat/gpio-nomadik.h>
47
48#include <mach/hardware.h> 45#include <mach/hardware.h>
49#include <mach/setup.h> 46#include <mach/setup.h>
50#include <mach/devices.h> 47#include <mach/devices.h>
@@ -229,6 +226,67 @@ static struct ab8500_platform_data ab8500_platdata = {
229}; 226};
230 227
231/* 228/*
229 * Thermal Sensor
230 */
231
232static struct resource db8500_thsens_resources[] = {
233 {
234 .name = "IRQ_HOTMON_LOW",
235 .start = IRQ_PRCMU_HOTMON_LOW,
236 .end = IRQ_PRCMU_HOTMON_LOW,
237 .flags = IORESOURCE_IRQ,
238 },
239 {
240 .name = "IRQ_HOTMON_HIGH",
241 .start = IRQ_PRCMU_HOTMON_HIGH,
242 .end = IRQ_PRCMU_HOTMON_HIGH,
243 .flags = IORESOURCE_IRQ,
244 },
245};
246
247static struct db8500_thsens_platform_data db8500_thsens_data = {
248 .trip_points[0] = {
249 .temp = 70000,
250 .type = THERMAL_TRIP_ACTIVE,
251 .cdev_name = {
252 [0] = "thermal-cpufreq-0",
253 },
254 },
255 .trip_points[1] = {
256 .temp = 75000,
257 .type = THERMAL_TRIP_ACTIVE,
258 .cdev_name = {
259 [0] = "thermal-cpufreq-0",
260 },
261 },
262 .trip_points[2] = {
263 .temp = 80000,
264 .type = THERMAL_TRIP_ACTIVE,
265 .cdev_name = {
266 [0] = "thermal-cpufreq-0",
267 },
268 },
269 .trip_points[3] = {
270 .temp = 85000,
271 .type = THERMAL_TRIP_CRITICAL,
272 },
273 .num_trips = 4,
274};
275
276static struct platform_device u8500_thsens_device = {
277 .name = "db8500-thermal",
278 .resource = db8500_thsens_resources,
279 .num_resources = ARRAY_SIZE(db8500_thsens_resources),
280 .dev = {
281 .platform_data = &db8500_thsens_data,
282 },
283};
284
285static struct platform_device u8500_cpufreq_cooling_device = {
286 .name = "db8500-cpufreq-cooling",
287};
288
289/*
232 * TPS61052 290 * TPS61052
233 */ 291 */
234 292
@@ -464,7 +522,7 @@ static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
464}; 522};
465#endif 523#endif
466 524
467static struct pl022_ssp_controller ssp0_plat = { 525struct pl022_ssp_controller ssp0_plat = {
468 .bus_id = 0, 526 .bus_id = 0,
469#ifdef CONFIG_STE_DMA40 527#ifdef CONFIG_STE_DMA40
470 .enable_dma = 1, 528 .enable_dma = 1,
@@ -541,7 +599,7 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
541}; 599};
542#endif 600#endif
543 601
544static struct amba_pl011_data uart0_plat = { 602struct amba_pl011_data uart0_plat = {
545#ifdef CONFIG_STE_DMA40 603#ifdef CONFIG_STE_DMA40
546 .dma_filter = stedma40_filter, 604 .dma_filter = stedma40_filter,
547 .dma_rx_param = &uart0_dma_cfg_rx, 605 .dma_rx_param = &uart0_dma_cfg_rx,
@@ -549,7 +607,7 @@ static struct amba_pl011_data uart0_plat = {
549#endif 607#endif
550}; 608};
551 609
552static struct amba_pl011_data uart1_plat = { 610struct amba_pl011_data uart1_plat = {
553#ifdef CONFIG_STE_DMA40 611#ifdef CONFIG_STE_DMA40
554 .dma_filter = stedma40_filter, 612 .dma_filter = stedma40_filter,
555 .dma_rx_param = &uart1_dma_cfg_rx, 613 .dma_rx_param = &uart1_dma_cfg_rx,
@@ -557,7 +615,7 @@ static struct amba_pl011_data uart1_plat = {
557#endif 615#endif
558}; 616};
559 617
560static struct amba_pl011_data uart2_plat = { 618struct amba_pl011_data uart2_plat = {
561#ifdef CONFIG_STE_DMA40 619#ifdef CONFIG_STE_DMA40
562 .dma_filter = stedma40_filter, 620 .dma_filter = stedma40_filter,
563 .dma_rx_param = &uart2_dma_cfg_rx, 621 .dma_rx_param = &uart2_dma_cfg_rx,
@@ -583,6 +641,8 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
583 &snowball_key_dev, 641 &snowball_key_dev,
584 &snowball_sbnet_dev, 642 &snowball_sbnet_dev,
585 &snowball_gpio_en_3v3_regulator_dev, 643 &snowball_gpio_en_3v3_regulator_dev,
644 &u8500_thsens_device,
645 &u8500_cpufreq_cooling_device,
586}; 646};
587 647
588static void __init mop500_init_machine(void) 648static void __init mop500_init_machine(void)
@@ -618,8 +678,6 @@ static void __init mop500_init_machine(void)
618 678
619 /* This board has full regulator constraints */ 679 /* This board has full regulator constraints */
620 regulator_has_full_constraints(); 680 regulator_has_full_constraints();
621
622 mop500_uib_init();
623} 681}
624 682
625static void __init snowball_init_machine(void) 683static void __init snowball_init_machine(void)
@@ -684,8 +742,6 @@ static void __init hrefv60_init_machine(void)
684 742
685 /* This board has full regulator constraints */ 743 /* This board has full regulator constraints */
686 regulator_has_full_constraints(); 744 regulator_has_full_constraints();
687
688 mop500_uib_init();
689} 745}
690 746
691MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 747MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -701,155 +757,35 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
701 .init_late = ux500_init_late, 757 .init_late = ux500_init_late,
702MACHINE_END 758MACHINE_END
703 759
704MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") 760MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
705 .atag_offset = 0x100, 761 .atag_offset = 0x100,
706 .smp = smp_ops(ux500_smp_ops),
707 .map_io = u8500_map_io, 762 .map_io = u8500_map_io,
708 .init_irq = ux500_init_irq, 763 .init_irq = ux500_init_irq,
709 .timer = &ux500_timer, 764 .timer = &ux500_timer,
710 .handle_irq = gic_handle_irq, 765 .handle_irq = gic_handle_irq,
711 .init_machine = hrefv60_init_machine, 766 .init_machine = mop500_init_machine,
712 .init_late = ux500_init_late, 767 .init_late = ux500_init_late,
713MACHINE_END 768MACHINE_END
714 769
715MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") 770MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
716 .atag_offset = 0x100, 771 .atag_offset = 0x100,
717 .smp = smp_ops(ux500_smp_ops), 772 .smp = smp_ops(ux500_smp_ops),
718 .map_io = u8500_map_io, 773 .map_io = u8500_map_io,
719 .init_irq = ux500_init_irq, 774 .init_irq = ux500_init_irq,
720 /* we re-use nomadik timer here */
721 .timer = &ux500_timer, 775 .timer = &ux500_timer,
722 .handle_irq = gic_handle_irq, 776 .handle_irq = gic_handle_irq,
723 .init_machine = snowball_init_machine, 777 .init_machine = hrefv60_init_machine,
724 .init_late = ux500_init_late, 778 .init_late = ux500_init_late,
725MACHINE_END 779MACHINE_END
726 780
727#ifdef CONFIG_MACH_UX500_DT 781MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
728 782 .atag_offset = 0x100,
729struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
730 /* Requires call-back bindings. */
731 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
732 /* Requires DMA and call-back bindings. */
733 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
734 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
735 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
736 /* Requires DMA bindings. */
737 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
738 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
739 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
740 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
741 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
742 /* Requires clock name bindings. */
743 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
744 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
745 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
746 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
747 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
748 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
749 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
750 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
751 OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
752 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL),
753 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL),
754 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
755 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
756 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
757 /* Requires device name bindings. */
758 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
759 /* Requires clock name and DMA bindings. */
760 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
761 "ux500-msp-i2s.0", &msp0_platform_data),
762 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
763 "ux500-msp-i2s.1", &msp1_platform_data),
764 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
765 "ux500-msp-i2s.2", &msp2_platform_data),
766 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
767 "ux500-msp-i2s.3", &msp3_platform_data),
768 {},
769};
770
771static const struct of_device_id u8500_local_bus_nodes[] = {
772 /* only create devices below soc node */
773 { .compatible = "stericsson,db8500", },
774 { .compatible = "stericsson,db8500-prcmu", },
775 { .compatible = "simple-bus"},
776 { },
777};
778
779static void __init u8500_init_machine(void)
780{
781 struct device *parent = NULL;
782 int i2c0_devs;
783 int i;
784
785 /* Pinmaps must be in place before devices register */
786 if (of_machine_is_compatible("st-ericsson,mop500"))
787 mop500_pinmaps_init();
788 else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
789 snowball_pinmaps_init();
790 else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
791 hrefv60_pinmaps_init();
792
793 parent = u8500_of_init_devices();
794
795 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
796 mop500_platform_devs[i]->dev.parent = parent;
797
798 /* automatically probe child nodes of db8500 device */
799 of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
800
801 if (of_machine_is_compatible("st-ericsson,mop500")) {
802 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
803
804 platform_add_devices(mop500_platform_devs,
805 ARRAY_SIZE(mop500_platform_devs));
806
807 mop500_sdi_init(parent);
808 mop500_audio_init(parent);
809 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
810 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
811 i2c_register_board_info(2, mop500_i2c2_devices,
812 ARRAY_SIZE(mop500_i2c2_devices));
813
814 mop500_uib_init();
815
816 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
817 mop500_of_audio_init(parent);
818 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
819 /*
820 * The HREFv60 board removed a GPIO expander and routed
821 * all these GPIO pins to the internal GPIO controller
822 * instead.
823 */
824 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
825 platform_add_devices(mop500_platform_devs,
826 ARRAY_SIZE(mop500_platform_devs));
827
828 mop500_uib_init();
829 }
830
831 /* This board has full regulator constraints */
832 regulator_has_full_constraints();
833}
834
835static const char * u8500_dt_board_compat[] = {
836 "calaosystems,snowball-a9500",
837 "st-ericsson,hrefv60+",
838 "st-ericsson,u8500",
839 "st-ericsson,mop500",
840 NULL,
841};
842
843
844DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
845 .smp = smp_ops(ux500_smp_ops), 783 .smp = smp_ops(ux500_smp_ops),
846 .map_io = u8500_map_io, 784 .map_io = u8500_map_io,
847 .init_irq = ux500_init_irq, 785 .init_irq = ux500_init_irq,
848 /* we re-use nomadik timer here */ 786 /* we re-use nomadik timer here */
849 .timer = &ux500_timer, 787 .timer = &ux500_timer,
850 .handle_irq = gic_handle_irq, 788 .handle_irq = gic_handle_irq,
851 .init_machine = u8500_init_machine, 789 .init_machine = snowball_init_machine,
852 .init_late = ux500_init_late, 790 .init_late = NULL,
853 .dt_compat = u8500_dt_board_compat,
854MACHINE_END 791MACHINE_END
855#endif