diff options
| -rw-r--r-- | arch/arm/include/asm/mach/arch.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/outercache.h | 4 | ||||
| -rw-r--r-- | arch/arm/mach-highbank/Kconfig | 6 | ||||
| -rw-r--r-- | arch/arm/mach-highbank/highbank.c | 20 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 2 | ||||
| -rw-r--r-- | drivers/dma/amba-pl08x.c | 23 |
6 files changed, 33 insertions, 24 deletions
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 441efc491b50..d91b16857971 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h | |||
| @@ -35,7 +35,7 @@ struct machine_desc { | |||
| 35 | unsigned int nr_irqs; /* number of IRQs */ | 35 | unsigned int nr_irqs; /* number of IRQs */ |
| 36 | 36 | ||
| 37 | #ifdef CONFIG_ZONE_DMA | 37 | #ifdef CONFIG_ZONE_DMA |
| 38 | unsigned long dma_zone_size; /* size of DMA-able area */ | 38 | phys_addr_t dma_zone_size; /* size of DMA-able area */ |
| 39 | #endif | 39 | #endif |
| 40 | 40 | ||
| 41 | unsigned int video_start; /* start of video RAM */ | 41 | unsigned int video_start; /* start of video RAM */ |
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index 12f71a190422..f94784f0e3a6 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h | |||
| @@ -37,10 +37,10 @@ struct outer_cache_fns { | |||
| 37 | void (*resume)(void); | 37 | void (*resume)(void); |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | #ifdef CONFIG_OUTER_CACHE | ||
| 41 | |||
| 42 | extern struct outer_cache_fns outer_cache; | 40 | extern struct outer_cache_fns outer_cache; |
| 43 | 41 | ||
| 42 | #ifdef CONFIG_OUTER_CACHE | ||
| 43 | |||
| 44 | static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) | 44 | static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) |
| 45 | { | 45 | { |
| 46 | if (outer_cache.inv_range) | 46 | if (outer_cache.inv_range) |
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig index cd9fcb1cd7ab..b9dd13ae3dca 100644 --- a/arch/arm/mach-highbank/Kconfig +++ b/arch/arm/mach-highbank/Kconfig | |||
| @@ -1,9 +1,14 @@ | |||
| 1 | config ARCH_HIGHBANK | 1 | config ARCH_HIGHBANK |
| 2 | bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7 | 2 | bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7 |
| 3 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | ||
| 3 | select ARCH_HAS_CPUFREQ | 4 | select ARCH_HAS_CPUFREQ |
| 5 | select ARCH_HAS_HOLES_MEMORYMODEL | ||
| 4 | select ARCH_HAS_OPP | 6 | select ARCH_HAS_OPP |
| 5 | select ARCH_WANT_OPTIONAL_GPIOLIB | 7 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 6 | select ARM_AMBA | 8 | select ARM_AMBA |
| 9 | select ARM_ERRATA_764369 | ||
| 10 | select ARM_ERRATA_775420 | ||
| 11 | select ARM_ERRATA_798181 | ||
| 7 | select ARM_GIC | 12 | select ARM_GIC |
| 8 | select ARM_TIMER_SP804 | 13 | select ARM_TIMER_SP804 |
| 9 | select CACHE_L2X0 | 14 | select CACHE_L2X0 |
| @@ -18,3 +23,4 @@ config ARCH_HIGHBANK | |||
| 18 | select PL320_MBOX | 23 | select PL320_MBOX |
| 19 | select SPARSE_IRQ | 24 | select SPARSE_IRQ |
| 20 | select USE_OF | 25 | select USE_OF |
| 26 | select ZONE_DMA if ARM_LPAE | ||
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 88815795fe26..8e63ccdb0de3 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
| @@ -18,14 +18,11 @@ | |||
| 18 | #include <linux/clocksource.h> | 18 | #include <linux/clocksource.h> |
| 19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
| 20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| 21 | #include <linux/irq.h> | ||
| 22 | #include <linux/irqchip.h> | 21 | #include <linux/irqchip.h> |
| 23 | #include <linux/irqdomain.h> | ||
| 24 | #include <linux/of.h> | 22 | #include <linux/of.h> |
| 25 | #include <linux/of_irq.h> | 23 | #include <linux/of_irq.h> |
| 26 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
| 27 | #include <linux/of_address.h> | 25 | #include <linux/of_address.h> |
| 28 | #include <linux/smp.h> | ||
| 29 | #include <linux/amba/bus.h> | 26 | #include <linux/amba/bus.h> |
| 30 | #include <linux/clk-provider.h> | 27 | #include <linux/clk-provider.h> |
| 31 | 28 | ||
| @@ -35,7 +32,6 @@ | |||
| 35 | #include <asm/hardware/cache-l2x0.h> | 32 | #include <asm/hardware/cache-l2x0.h> |
| 36 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
| 37 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
| 38 | #include <asm/mach/time.h> | ||
| 39 | 35 | ||
| 40 | #include "core.h" | 36 | #include "core.h" |
| 41 | #include "sysregs.h" | 37 | #include "sysregs.h" |
| @@ -65,13 +61,11 @@ void highbank_set_cpu_jump(int cpu, void *jump_addr) | |||
| 65 | HB_JUMP_TABLE_PHYS(cpu) + 15); | 61 | HB_JUMP_TABLE_PHYS(cpu) + 15); |
| 66 | } | 62 | } |
| 67 | 63 | ||
| 68 | #ifdef CONFIG_CACHE_L2X0 | ||
| 69 | static void highbank_l2x0_disable(void) | 64 | static void highbank_l2x0_disable(void) |
| 70 | { | 65 | { |
| 71 | /* Disable PL310 L2 Cache controller */ | 66 | /* Disable PL310 L2 Cache controller */ |
| 72 | highbank_smc1(0x102, 0x0); | 67 | highbank_smc1(0x102, 0x0); |
| 73 | } | 68 | } |
| 74 | #endif | ||
| 75 | 69 | ||
| 76 | static void __init highbank_init_irq(void) | 70 | static void __init highbank_init_irq(void) |
| 77 | { | 71 | { |
| @@ -80,12 +74,13 @@ static void __init highbank_init_irq(void) | |||
| 80 | if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) | 74 | if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) |
| 81 | highbank_scu_map_io(); | 75 | highbank_scu_map_io(); |
| 82 | 76 | ||
| 83 | #ifdef CONFIG_CACHE_L2X0 | ||
| 84 | /* Enable PL310 L2 Cache controller */ | 77 | /* Enable PL310 L2 Cache controller */ |
| 85 | highbank_smc1(0x102, 0x1); | 78 | if (IS_ENABLED(CONFIG_CACHE_L2X0) && |
| 86 | l2x0_of_init(0, ~0UL); | 79 | of_find_compatible_node(NULL, NULL, "arm,pl310-cache")) { |
| 87 | outer_cache.disable = highbank_l2x0_disable; | 80 | highbank_smc1(0x102, 0x1); |
| 88 | #endif | 81 | l2x0_of_init(0, ~0UL); |
| 82 | outer_cache.disable = highbank_l2x0_disable; | ||
| 83 | } | ||
| 89 | } | 84 | } |
| 90 | 85 | ||
| 91 | static void __init highbank_timer_init(void) | 86 | static void __init highbank_timer_init(void) |
| @@ -176,6 +171,9 @@ static const char *highbank_match[] __initconst = { | |||
| 176 | }; | 171 | }; |
| 177 | 172 | ||
| 178 | DT_MACHINE_START(HIGHBANK, "Highbank") | 173 | DT_MACHINE_START(HIGHBANK, "Highbank") |
| 174 | #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) | ||
| 175 | .dma_zone_size = (4ULL * SZ_1G), | ||
| 176 | #endif | ||
| 179 | .smp = smp_ops(highbank_smp_ops), | 177 | .smp = smp_ops(highbank_smp_ops), |
| 180 | .init_irq = highbank_init_irq, | 178 | .init_irq = highbank_init_irq, |
| 181 | .init_time = highbank_timer_init, | 179 | .init_time = highbank_timer_init, |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 15225d829d71..c0bb66e69999 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -207,7 +207,7 @@ static void __init arm_bootmem_init(unsigned long start_pfn, | |||
| 207 | 207 | ||
| 208 | #ifdef CONFIG_ZONE_DMA | 208 | #ifdef CONFIG_ZONE_DMA |
| 209 | 209 | ||
| 210 | unsigned long arm_dma_zone_size __read_mostly; | 210 | phys_addr_t arm_dma_zone_size __read_mostly; |
| 211 | EXPORT_SYMBOL(arm_dma_zone_size); | 211 | EXPORT_SYMBOL(arm_dma_zone_size); |
| 212 | 212 | ||
| 213 | /* | 213 | /* |
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 06fe45c74de5..bff41d4848e5 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
| @@ -133,6 +133,8 @@ struct pl08x_bus_data { | |||
| 133 | u8 buswidth; | 133 | u8 buswidth; |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
| 136 | #define IS_BUS_ALIGNED(bus) IS_ALIGNED((bus)->addr, (bus)->buswidth) | ||
| 137 | |||
| 136 | /** | 138 | /** |
| 137 | * struct pl08x_phy_chan - holder for the physical channels | 139 | * struct pl08x_phy_chan - holder for the physical channels |
| 138 | * @id: physical index to this channel | 140 | * @id: physical index to this channel |
| @@ -845,10 +847,13 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
| 845 | 847 | ||
| 846 | pl08x_choose_master_bus(&bd, &mbus, &sbus, cctl); | 848 | pl08x_choose_master_bus(&bd, &mbus, &sbus, cctl); |
| 847 | 849 | ||
| 848 | dev_vdbg(&pl08x->adev->dev, "src=0x%08x%s/%u dst=0x%08x%s/%u len=%zu\n", | 850 | dev_vdbg(&pl08x->adev->dev, |
| 849 | bd.srcbus.addr, cctl & PL080_CONTROL_SRC_INCR ? "+" : "", | 851 | "src=0x%08llx%s/%u dst=0x%08llx%s/%u len=%zu\n", |
| 852 | (u64)bd.srcbus.addr, | ||
| 853 | cctl & PL080_CONTROL_SRC_INCR ? "+" : "", | ||
| 850 | bd.srcbus.buswidth, | 854 | bd.srcbus.buswidth, |
| 851 | bd.dstbus.addr, cctl & PL080_CONTROL_DST_INCR ? "+" : "", | 855 | (u64)bd.dstbus.addr, |
| 856 | cctl & PL080_CONTROL_DST_INCR ? "+" : "", | ||
| 852 | bd.dstbus.buswidth, | 857 | bd.dstbus.buswidth, |
| 853 | bd.remainder); | 858 | bd.remainder); |
| 854 | dev_vdbg(&pl08x->adev->dev, "mbus=%s sbus=%s\n", | 859 | dev_vdbg(&pl08x->adev->dev, "mbus=%s sbus=%s\n", |
| @@ -886,8 +891,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
| 886 | return 0; | 891 | return 0; |
| 887 | } | 892 | } |
| 888 | 893 | ||
| 889 | if ((bd.srcbus.addr % bd.srcbus.buswidth) || | 894 | if (!IS_BUS_ALIGNED(&bd.srcbus) || |
| 890 | (bd.dstbus.addr % bd.dstbus.buswidth)) { | 895 | !IS_BUS_ALIGNED(&bd.dstbus)) { |
| 891 | dev_err(&pl08x->adev->dev, | 896 | dev_err(&pl08x->adev->dev, |
| 892 | "%s src & dst address must be aligned to src" | 897 | "%s src & dst address must be aligned to src" |
| 893 | " & dst width if peripheral is flow controller", | 898 | " & dst width if peripheral is flow controller", |
| @@ -908,9 +913,9 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
| 908 | */ | 913 | */ |
| 909 | if (bd.remainder < mbus->buswidth) | 914 | if (bd.remainder < mbus->buswidth) |
| 910 | early_bytes = bd.remainder; | 915 | early_bytes = bd.remainder; |
| 911 | else if ((mbus->addr) % (mbus->buswidth)) { | 916 | else if (!IS_BUS_ALIGNED(mbus)) { |
| 912 | early_bytes = mbus->buswidth - (mbus->addr) % | 917 | early_bytes = mbus->buswidth - |
| 913 | (mbus->buswidth); | 918 | (mbus->addr & (mbus->buswidth - 1)); |
| 914 | if ((bd.remainder - early_bytes) < mbus->buswidth) | 919 | if ((bd.remainder - early_bytes) < mbus->buswidth) |
| 915 | early_bytes = bd.remainder; | 920 | early_bytes = bd.remainder; |
| 916 | } | 921 | } |
| @@ -928,7 +933,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
| 928 | * Master now aligned | 933 | * Master now aligned |
| 929 | * - if slave is not then we must set its width down | 934 | * - if slave is not then we must set its width down |
| 930 | */ | 935 | */ |
| 931 | if (sbus->addr % sbus->buswidth) { | 936 | if (!IS_BUS_ALIGNED(sbus)) { |
| 932 | dev_dbg(&pl08x->adev->dev, | 937 | dev_dbg(&pl08x->adev->dev, |
| 933 | "%s set down bus width to one byte\n", | 938 | "%s set down bus width to one byte\n", |
| 934 | __func__); | 939 | __func__); |
