diff options
author | Olof Johansson <olof@lixom.net> | 2013-04-18 02:53:11 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-04-18 02:53:20 -0400 |
commit | a100caaf12c871f040d34437229156b8b5670059 (patch) | |
tree | ce2364b86eb2342f78bde84fb870b15444eab0ec | |
parent | b56a7f9206efa2982140837e36aca88cfedd66bc (diff) | |
parent | 215a084dc5cb8d814aeb7a2b5192af20aec8209f (diff) |
Merge tag 'davinci-for-v3.10/soc-2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc
From Sekhar Nori:
v3.10 SoC updates for DaVinci
This set of patches add support for remoteproc
used to control the DSP and also fix sparse
errors existing for quite some time.
* tag 'davinci-for-v3.10/soc-2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
ARM: davinci: ensure global variables are declared
ARM: davinci: sram.c: fix incorrect type in assignment
ARM: davinci: da8xx dt: make file local symbols static
ARM: davinci: da8xx: add remoteproc support
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | Documentation/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | arch/arm/mach-davinci/da8xx-dt.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 88 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/da8xx.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/pm.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-davinci/sram.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/usb.c | 1 |
7 files changed, 103 insertions, 5 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4609e81dbc37..4a6d96214eed 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -44,6 +44,7 @@ parameter is applicable: | |||
44 | AVR32 AVR32 architecture is enabled. | 44 | AVR32 AVR32 architecture is enabled. |
45 | AX25 Appropriate AX.25 support is enabled. | 45 | AX25 Appropriate AX.25 support is enabled. |
46 | BLACKFIN Blackfin architecture is enabled. | 46 | BLACKFIN Blackfin architecture is enabled. |
47 | CMA Contiguous Memory Area support is enabled. | ||
47 | DRM Direct Rendering Management support is enabled. | 48 | DRM Direct Rendering Management support is enabled. |
48 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | 49 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime |
49 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 50 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
@@ -2663,6 +2664,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2663 | Useful for devices that are detected asynchronously | 2664 | Useful for devices that are detected asynchronously |
2664 | (e.g. USB and MMC devices). | 2665 | (e.g. USB and MMC devices). |
2665 | 2666 | ||
2667 | rproc_mem=nn[KMG][@address] | ||
2668 | [KNL,ARM,CMA] Remoteproc physical memory block. | ||
2669 | Memory area to be used by remote processor image, | ||
2670 | managed by CMA. | ||
2671 | |||
2666 | rw [KNL] Mount root device read-write on boot | 2672 | rw [KNL] Mount root device read-write on boot |
2667 | 2673 | ||
2668 | S [KNL] Run init in single mode | 2674 | S [KNL] Run init in single mode |
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index d83de8f8fa6b..b1c0a5958275 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #define DA8XX_NUM_UARTS 3 | 21 | #define DA8XX_NUM_UARTS 3 |
22 | 22 | ||
23 | void __init da8xx_uart_clk_enable(void) | 23 | static void __init da8xx_uart_clk_enable(void) |
24 | { | 24 | { |
25 | int i; | 25 | int i; |
26 | for (i = 0; i < DA8XX_NUM_UARTS; i++) | 26 | for (i = 0; i < DA8XX_NUM_UARTS; i++) |
@@ -37,7 +37,7 @@ static void __init da8xx_init_irq(void) | |||
37 | of_irq_init(da8xx_irq_match); | 37 | of_irq_init(da8xx_irq_match); |
38 | } | 38 | } |
39 | 39 | ||
40 | struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { | 40 | static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { |
41 | OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), | 41 | OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), |
42 | OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), | 42 | OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), |
43 | OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL), | 43 | OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL), |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index cb97e07db284..bf572525175d 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-contiguous.h> |
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/ahci_platform.h> | 17 | #include <linux/ahci_platform.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
@@ -714,6 +714,92 @@ int __init da850_register_mmcsd1(struct davinci_mmc_config *config) | |||
714 | } | 714 | } |
715 | #endif | 715 | #endif |
716 | 716 | ||
717 | static struct resource da8xx_rproc_resources[] = { | ||
718 | { /* DSP boot address */ | ||
719 | .start = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG, | ||
720 | .end = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG + 3, | ||
721 | .flags = IORESOURCE_MEM, | ||
722 | }, | ||
723 | { /* DSP interrupt registers */ | ||
724 | .start = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG, | ||
725 | .end = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG + 7, | ||
726 | .flags = IORESOURCE_MEM, | ||
727 | }, | ||
728 | { /* dsp irq */ | ||
729 | .start = IRQ_DA8XX_CHIPINT0, | ||
730 | .end = IRQ_DA8XX_CHIPINT0, | ||
731 | .flags = IORESOURCE_IRQ, | ||
732 | }, | ||
733 | }; | ||
734 | |||
735 | static struct platform_device da8xx_dsp = { | ||
736 | .name = "davinci-rproc", | ||
737 | .dev = { | ||
738 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
739 | }, | ||
740 | .num_resources = ARRAY_SIZE(da8xx_rproc_resources), | ||
741 | .resource = da8xx_rproc_resources, | ||
742 | }; | ||
743 | |||
744 | #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC) | ||
745 | |||
746 | static phys_addr_t rproc_base __initdata; | ||
747 | static unsigned long rproc_size __initdata; | ||
748 | |||
749 | static int __init early_rproc_mem(char *p) | ||
750 | { | ||
751 | char *endp; | ||
752 | |||
753 | if (p == NULL) | ||
754 | return 0; | ||
755 | |||
756 | rproc_size = memparse(p, &endp); | ||
757 | if (*endp == '@') | ||
758 | rproc_base = memparse(endp + 1, NULL); | ||
759 | |||
760 | return 0; | ||
761 | } | ||
762 | early_param("rproc_mem", early_rproc_mem); | ||
763 | |||
764 | void __init da8xx_rproc_reserve_cma(void) | ||
765 | { | ||
766 | int ret; | ||
767 | |||
768 | if (!rproc_base || !rproc_size) { | ||
769 | pr_err("%s: 'rproc_mem=nn@address' badly specified\n" | ||
770 | " 'nn' and 'address' must both be non-zero\n", | ||
771 | __func__); | ||
772 | |||
773 | return; | ||
774 | } | ||
775 | |||
776 | pr_info("%s: reserving 0x%lx @ 0x%lx...\n", | ||
777 | __func__, rproc_size, (unsigned long)rproc_base); | ||
778 | |||
779 | ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0); | ||
780 | if (ret) | ||
781 | pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret); | ||
782 | } | ||
783 | |||
784 | #else | ||
785 | |||
786 | void __init da8xx_rproc_reserve_cma(void) | ||
787 | { | ||
788 | } | ||
789 | |||
790 | #endif | ||
791 | |||
792 | int __init da8xx_register_rproc(void) | ||
793 | { | ||
794 | int ret; | ||
795 | |||
796 | ret = platform_device_register(&da8xx_dsp); | ||
797 | if (ret) | ||
798 | pr_err("%s: can't register DSP device: %d\n", __func__, ret); | ||
799 | |||
800 | return ret; | ||
801 | }; | ||
802 | |||
717 | static struct resource da8xx_rtc_resources[] = { | 803 | static struct resource da8xx_rtc_resources[] = { |
718 | { | 804 | { |
719 | .start = DA8XX_RTC_BASE, | 805 | .start = DA8XX_RTC_BASE, |
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index be77ce269cb0..2e1c9eae0a58 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h | |||
@@ -54,6 +54,8 @@ extern unsigned int da850_max_speed; | |||
54 | #define DA8XX_SYSCFG0_BASE (IO_PHYS + 0x14000) | 54 | #define DA8XX_SYSCFG0_BASE (IO_PHYS + 0x14000) |
55 | #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) | 55 | #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) |
56 | #define DA8XX_JTAG_ID_REG 0x18 | 56 | #define DA8XX_JTAG_ID_REG 0x18 |
57 | #define DA8XX_HOST1CFG_REG 0x44 | ||
58 | #define DA8XX_CHIPSIG_REG 0x174 | ||
57 | #define DA8XX_CFGCHIP0_REG 0x17c | 59 | #define DA8XX_CFGCHIP0_REG 0x17c |
58 | #define DA8XX_CFGCHIP1_REG 0x180 | 60 | #define DA8XX_CFGCHIP1_REG 0x180 |
59 | #define DA8XX_CFGCHIP2_REG 0x184 | 61 | #define DA8XX_CFGCHIP2_REG 0x184 |
@@ -105,6 +107,8 @@ int __init da850_register_vpif_display | |||
105 | int __init da850_register_vpif_capture | 107 | int __init da850_register_vpif_capture |
106 | (struct vpif_capture_config *capture_config); | 108 | (struct vpif_capture_config *capture_config); |
107 | void da8xx_restart(char mode, const char *cmd); | 109 | void da8xx_restart(char mode, const char *cmd); |
110 | void da8xx_rproc_reserve_cma(void); | ||
111 | int da8xx_register_rproc(void); | ||
108 | 112 | ||
109 | extern struct platform_device da8xx_serial_device; | 113 | extern struct platform_device da8xx_serial_device; |
110 | extern struct emac_platform_data da8xx_emac_pdata; | 114 | extern struct emac_platform_data da8xx_emac_pdata; |
diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index eb8360b33aa9..a508fe587af7 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/delay.h> | 19 | #include <asm/delay.h> |
20 | #include <asm/io.h> | 20 | #include <asm/io.h> |
21 | 21 | ||
22 | #include <mach/common.h> | ||
22 | #include <mach/da8xx.h> | 23 | #include <mach/da8xx.h> |
23 | #include <mach/sram.h> | 24 | #include <mach/sram.h> |
24 | #include <mach/pm.h> | 25 | #include <mach/pm.h> |
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c index c5f7ee5cc80a..f18928b073f5 100644 --- a/arch/arm/mach-davinci/sram.c +++ b/arch/arm/mach-davinci/sram.c | |||
@@ -62,7 +62,7 @@ static int __init sram_init(void) | |||
62 | phys_addr_t phys = davinci_soc_info.sram_dma; | 62 | phys_addr_t phys = davinci_soc_info.sram_dma; |
63 | unsigned len = davinci_soc_info.sram_len; | 63 | unsigned len = davinci_soc_info.sram_len; |
64 | int status = 0; | 64 | int status = 0; |
65 | void *addr; | 65 | void __iomem *addr; |
66 | 66 | ||
67 | if (len) { | 67 | if (len) { |
68 | len = min_t(unsigned, len, SRAM_SIZE); | 68 | len = min_t(unsigned, len, SRAM_SIZE); |
@@ -75,7 +75,7 @@ static int __init sram_init(void) | |||
75 | addr = ioremap(phys, len); | 75 | addr = ioremap(phys, len); |
76 | if (!addr) | 76 | if (!addr) |
77 | return -ENOMEM; | 77 | return -ENOMEM; |
78 | status = gen_pool_add_virt(sram_pool, (unsigned)addr, | 78 | status = gen_pool_add_virt(sram_pool, (unsigned long) addr, |
79 | phys, len, -1); | 79 | phys, len, -1); |
80 | if (status < 0) | 80 | if (status < 0) |
81 | iounmap(addr); | 81 | iounmap(addr); |
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c index 34509ffba221..2b4c648f99b6 100644 --- a/arch/arm/mach-davinci/usb.c +++ b/arch/arm/mach-davinci/usb.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <mach/common.h> | 10 | #include <mach/common.h> |
11 | #include <mach/irqs.h> | 11 | #include <mach/irqs.h> |
12 | #include <mach/cputype.h> | 12 | #include <mach/cputype.h> |
13 | #include <mach/da8xx.h> | ||
13 | #include <linux/platform_data/usb-davinci.h> | 14 | #include <linux/platform_data/usb-davinci.h> |
14 | 15 | ||
15 | #define DAVINCI_USB_OTG_BASE 0x01c64000 | 16 | #define DAVINCI_USB_OTG_BASE 0x01c64000 |