Commit bf027ca13738b1548910351952c3fe9b63263a9a

Authored by Tony Lindgren
1 parent eba36d77a8

ARM: OMAP: Split sram.h to local headers and minimal shared header

Most of the defines are specific to omap1 and omap2+,
and should be in the local headers. Only minimal function
prototypes need to be shared.

As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* shared code:

http://www.spinics.net/lists/linux-omap/msg80520.html

So this patch re-adds a minimal plat/sram.h.

The new plat/sram.h must not be included from drivers,
that will break build for omap2+ CONFIG_MULTIPLATFORM.

Note that this patch temporarily adds two more
relative includes; Those will be removed in the
following patch.

Signed-off-by: Tony Lindgren <tony@atomide.com>

Showing 19 changed files with 121 additions and 137 deletions Side-by-side Diff

arch/arm/mach-omap1/clock.c
... ... @@ -24,12 +24,11 @@
24 24  
25 25 #include <mach/hardware.h>
26 26  
27   -#include "../plat-omap/sram.h"
28   -
29 27 #include "soc.h"
30 28 #include "iomap.h"
31 29 #include "clock.h"
32 30 #include "opp.h"
  31 +#include "sram.h"
33 32  
34 33 __u32 arm_idlect1_mask;
35 34 struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
arch/arm/mach-omap1/clock_data.c
... ... @@ -27,10 +27,9 @@
27 27 #include <mach/hardware.h>
28 28 #include <mach/usb.h> /* for OTG_BASE */
29 29  
30   -#include "../plat-omap/sram.h"
31   -
32 30 #include "iomap.h"
33 31 #include "clock.h"
  32 +#include "sram.h"
34 33  
35 34 /* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */
36 35 #define IDL_CLKOUT_ARM_SHIFT 12
arch/arm/mach-omap1/devices.c
... ... @@ -26,12 +26,11 @@
26 26 #include <mach/camera.h>
27 27 #include <mach/hardware.h>
28 28  
29   -#include "../plat-omap/sram.h"
30   -
31 29 #include "common.h"
32 30 #include "clock.h"
33 31 #include "dma.h"
34 32 #include "mmc.h"
  33 +#include "sram.h"
35 34  
36 35 #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
37 36  
arch/arm/mach-omap1/pm.c
... ... @@ -44,6 +44,7 @@
44 44 #include <linux/io.h>
45 45 #include <linux/atomic.h>
46 46  
  47 +#include <asm/fncpy.h>
47 48 #include <asm/system_misc.h>
48 49 #include <asm/irq.h>
49 50 #include <asm/mach/time.h>
50 51  
... ... @@ -56,11 +57,10 @@
56 57  
57 58 #include <mach/irqs.h>
58 59  
59   -#include "../plat-omap/sram.h"
60   -
61 60 #include "iomap.h"
62 61 #include "clock.h"
63 62 #include "pm.h"
  63 +#include "sram.h"
64 64  
65 65 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
66 66 static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
arch/arm/mach-omap1/sram.h
  1 +#include <plat/sram.h>
  2 +
  3 +extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
  4 +
  5 +/* Do not use these */
  6 +extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
  7 +extern unsigned long omap1_sram_reprogram_clock_sz;
arch/arm/mach-omap2/clkt2xxx_dpllcore.c
... ... @@ -25,14 +25,13 @@
25 25 #include <linux/clk.h>
26 26 #include <linux/io.h>
27 27  
28   -#include "../plat-omap/sram.h"
29   -
30 28 #include "clock.h"
31 29 #include "clock2xxx.h"
32 30 #include "opp2xxx.h"
33 31 #include "cm2xxx_3xxx.h"
34 32 #include "cm-regbits-24xx.h"
35 33 #include "sdrc.h"
  34 +#include "sram.h"
36 35  
37 36 /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
38 37  
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
... ... @@ -33,8 +33,6 @@
33 33 #include <linux/cpufreq.h>
34 34 #include <linux/slab.h>
35 35  
36   -#include "../plat-omap/sram.h"
37   -
38 36 #include "soc.h"
39 37 #include "clock.h"
40 38 #include "clock2xxx.h"
... ... @@ -42,6 +40,7 @@
42 40 #include "cm2xxx_3xxx.h"
43 41 #include "cm-regbits-24xx.h"
44 42 #include "sdrc.h"
  43 +#include "sram.h"
45 44  
46 45 const struct prcm_config *curr_prcm_set;
47 46 const struct prcm_config *rate_table;
arch/arm/mach-omap2/clkt34xx_dpll3m2.c
... ... @@ -21,12 +21,11 @@
21 21 #include <linux/clk.h>
22 22 #include <linux/io.h>
23 23  
24   -#include "../plat-omap/sram.h"
25   -
26 24 #include "clock.h"
27 25 #include "clock3xxx.h"
28 26 #include "clock34xx.h"
29 27 #include "sdrc.h"
  28 +#include "sram.h"
30 29  
31 30 #define CYCLES_PER_MHZ 1000000
32 31  
arch/arm/mach-omap2/io.c
... ... @@ -27,8 +27,6 @@
27 27  
28 28 #include <plat-omap/dma-omap.h>
29 29  
30   -#include "../plat-omap/sram.h"
31   -
32 30 #include "omap_hwmod.h"
33 31 #include "soc.h"
34 32 #include "iomap.h"
... ... @@ -43,6 +41,7 @@
43 41 #include "omap-pm.h"
44 42 #include "sdrc.h"
45 43 #include "serial.h"
  44 +#include "sram.h"
46 45  
47 46 /*
48 47 * The machine specific code may provide the extra mapping besides the
arch/arm/mach-omap2/omap4-common.c
... ... @@ -25,8 +25,6 @@
25 25 #include <asm/mach/map.h>
26 26 #include <asm/memblock.h>
27 27  
28   -#include "../plat-omap/sram.h"
29   -
30 28 #include "omap-wakeupgen.h"
31 29 #include "soc.h"
32 30 #include "common.h"
arch/arm/mach-omap2/pm24xx.c
... ... @@ -31,6 +31,8 @@
31 31 #include <linux/gpio.h>
32 32 #include <linux/platform_data/gpio-omap.h>
33 33  
  34 +#include <asm/fncpy.h>
  35 +
34 36 #include <asm/mach/time.h>
35 37 #include <asm/mach/irq.h>
36 38 #include <asm/mach-types.h>
... ... @@ -38,8 +40,6 @@
38 40  
39 41 #include <plat-omap/dma-omap.h>
40 42  
41   -#include "../plat-omap/sram.h"
42   -
43 43 #include "soc.h"
44 44 #include "common.h"
45 45 #include "clock.h"
... ... @@ -48,6 +48,7 @@
48 48 #include "cm2xxx_3xxx.h"
49 49 #include "cm-regbits-24xx.h"
50 50 #include "sdrc.h"
  51 +#include "sram.h"
51 52 #include "pm.h"
52 53 #include "control.h"
53 54 #include "powerdomain.h"
arch/arm/mach-omap2/pm34xx.c
... ... @@ -32,6 +32,7 @@
32 32  
33 33 #include <trace/events/power.h>
34 34  
  35 +#include <asm/fncpy.h>
35 36 #include <asm/suspend.h>
36 37 #include <asm/system_misc.h>
37 38  
... ... @@ -40,8 +41,6 @@
40 41 #include <plat/prcm.h>
41 42 #include <plat-omap/dma-omap.h>
42 43  
43   -#include "../plat-omap/sram.h"
44   -
45 44 #include "soc.h"
46 45 #include "common.h"
47 46 #include "cm2xxx_3xxx.h"
... ... @@ -52,6 +51,7 @@
52 51 #include "prm2xxx_3xxx.h"
53 52 #include "pm.h"
54 53 #include "sdrc.h"
  54 +#include "sram.h"
55 55 #include "control.h"
56 56  
57 57 /* pm34xx errata defined in pm.h */
arch/arm/mach-omap2/sdrc.c
... ... @@ -23,8 +23,6 @@
23 23 #include <linux/clk.h>
24 24 #include <linux/io.h>
25 25  
26   -#include "../plat-omap/sram.h"
27   -
28 26 #include "common.h"
29 27 #include "clock.h"
30 28 #include "sdrc.h"
arch/arm/mach-omap2/sdrc2xxx.c
... ... @@ -24,14 +24,13 @@
24 24 #include <linux/clk.h>
25 25 #include <linux/io.h>
26 26  
27   -#include "../plat-omap/sram.h"
28   -
29 27 #include "soc.h"
30 28 #include "iomap.h"
31 29 #include "common.h"
32 30 #include "prm2xxx_3xxx.h"
33 31 #include "clock.h"
34 32 #include "sdrc.h"
  33 +#include "sram.h"
35 34  
36 35 /* Memory timing, DLL mode flags */
37 36 #define M_DDR 1
arch/arm/mach-omap2/sleep34xx.S
... ... @@ -26,13 +26,12 @@
26 26  
27 27 #include <asm/assembler.h>
28 28  
29   -#include "../plat-omap/sram.h"
30   -
31 29 #include "omap34xx.h"
32 30 #include "iomap.h"
33 31 #include "cm2xxx_3xxx.h"
34 32 #include "prm2xxx_3xxx.h"
35 33 #include "sdrc.h"
  34 +#include "sram.h"
36 35 #include "control.h"
37 36  
38 37 /*
arch/arm/mach-omap2/sram.h
  1 +/*
  2 + * Interface for functions that need to be run in internal SRAM
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License version 2 as
  6 + * published by the Free Software Foundation.
  7 + */
  8 +
  9 +#ifndef __ASSEMBLY__
  10 +#include <plat/sram.h>
  11 +
  12 +extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  13 + u32 base_cs, u32 force_unlock);
  14 +extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  15 + u32 mem_type);
  16 +extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
  17 +
  18 +extern u32 omap3_configure_core_dpll(
  19 + u32 m2, u32 unlock_dll, u32 f, u32 inc,
  20 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
  21 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
  22 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
  23 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
  24 +extern void omap3_sram_restore_context(void);
  25 +
  26 +/* Do not use these */
  27 +extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
  28 +extern unsigned long omap24xx_sram_reprogram_clock_sz;
  29 +
  30 +extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  31 + u32 base_cs, u32 force_unlock);
  32 +extern unsigned long omap242x_sram_ddr_init_sz;
  33 +
  34 +extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
  35 + int bypass);
  36 +extern unsigned long omap242x_sram_set_prcm_sz;
  37 +
  38 +extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  39 + u32 mem_type);
  40 +extern unsigned long omap242x_sram_reprogram_sdrc_sz;
  41 +
  42 +
  43 +extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  44 + u32 base_cs, u32 force_unlock);
  45 +extern unsigned long omap243x_sram_ddr_init_sz;
  46 +
  47 +extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
  48 + int bypass);
  49 +extern unsigned long omap243x_sram_set_prcm_sz;
  50 +
  51 +extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  52 + u32 mem_type);
  53 +extern unsigned long omap243x_sram_reprogram_sdrc_sz;
  54 +
  55 +extern u32 omap3_sram_configure_core_dpll(
  56 + u32 m2, u32 unlock_dll, u32 f, u32 inc,
  57 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
  58 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
  59 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
  60 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
  61 +extern unsigned long omap3_sram_configure_core_dpll_sz;
  62 +
  63 +#ifdef CONFIG_PM
  64 +extern void omap_push_sram_idle(void);
  65 +#else
  66 +static inline void omap_push_sram_idle(void) {}
  67 +#endif /* CONFIG_PM */
  68 +
  69 +#endif /* __ASSEMBLY__ */
  70 +
  71 +/*
  72 + * OMAP2+: define the SRAM PA addresses.
  73 + * Used by the SRAM management code and the idle sleep code.
  74 + */
  75 +#define OMAP2_SRAM_PA 0x40200000
  76 +#define OMAP3_SRAM_PA 0x40200000
  77 +#ifdef CONFIG_OMAP4_ERRATA_I688
  78 +#define OMAP4_SRAM_PA 0x40304000
  79 +#define OMAP4_SRAM_VA 0xfe404000
  80 +#else
  81 +#define OMAP4_SRAM_PA 0x40300000
  82 +#endif
  83 +#define AM33XX_SRAM_PA 0x40300000
arch/arm/plat-omap/include/plat/sram.h
  1 +int omap_sram_init(void);
  2 +
  3 +extern void *omap_sram_push_address(unsigned long size);
  4 +
  5 +/* Macro to push a function to the internal SRAM, using the fncpy API */
  6 +#define omap_sram_push(funcp, size) ({ \
  7 + typeof(&(funcp)) _res = NULL; \
  8 + void *_sram_address = omap_sram_push_address(size); \
  9 + if (_sram_address) \
  10 + _res = fncpy(_sram_address, &(funcp), size); \
  11 + _res; \
  12 +})
arch/arm/plat-omap/sram.c
... ... @@ -20,15 +20,16 @@
20 20 #include <linux/init.h>
21 21 #include <linux/io.h>
22 22  
  23 +#include <asm/fncpy.h>
23 24 #include <asm/tlb.h>
24 25 #include <asm/cacheflush.h>
25 26  
26 27 #include <asm/mach/map.h>
27 28  
28 29 #include "../mach-omap1/soc.h"
  30 +#include "../mach-omap1/sram.h"
29 31 #include "../mach-omap2/soc.h"
30   -
31   -#include "sram.h"
  32 +#include "../mach-omap2/sram.h"
32 33  
33 34 /* XXX These "sideways" includes will disappear when sram.c becomes a driver */
34 35 #include "../mach-omap2/iomap.h"
arch/arm/plat-omap/sram.h
1   -/*
2   - * arch/arm/plat-omap/include/mach/sram.h
3   - *
4   - * Interface for functions that need to be run in internal SRAM
5   - *
6   - * This program is free software; you can redistribute it and/or modify
7   - * it under the terms of the GNU General Public License version 2 as
8   - * published by the Free Software Foundation.
9   - */
10   -
11   -#ifndef __ARCH_ARM_OMAP_SRAM_H
12   -#define __ARCH_ARM_OMAP_SRAM_H
13   -
14   -#ifndef __ASSEMBLY__
15   -#include <asm/fncpy.h>
16   -
17   -int __init omap_sram_init(void);
18   -
19   -extern void *omap_sram_push_address(unsigned long size);
20   -
21   -/* Macro to push a function to the internal SRAM, using the fncpy API */
22   -#define omap_sram_push(funcp, size) ({ \
23   - typeof(&(funcp)) _res = NULL; \
24   - void *_sram_address = omap_sram_push_address(size); \
25   - if (_sram_address) \
26   - _res = fncpy(_sram_address, &(funcp), size); \
27   - _res; \
28   -})
29   -
30   -extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
31   -
32   -extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
33   - u32 base_cs, u32 force_unlock);
34   -extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
35   - u32 mem_type);
36   -extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
37   -
38   -extern u32 omap3_configure_core_dpll(
39   - u32 m2, u32 unlock_dll, u32 f, u32 inc,
40   - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
41   - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
42   - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
43   - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
44   -extern void omap3_sram_restore_context(void);
45   -
46   -/* Do not use these */
47   -extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
48   -extern unsigned long omap1_sram_reprogram_clock_sz;
49   -
50   -extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
51   -extern unsigned long omap24xx_sram_reprogram_clock_sz;
52   -
53   -extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
54   - u32 base_cs, u32 force_unlock);
55   -extern unsigned long omap242x_sram_ddr_init_sz;
56   -
57   -extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
58   - int bypass);
59   -extern unsigned long omap242x_sram_set_prcm_sz;
60   -
61   -extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
62   - u32 mem_type);
63   -extern unsigned long omap242x_sram_reprogram_sdrc_sz;
64   -
65   -
66   -extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
67   - u32 base_cs, u32 force_unlock);
68   -extern unsigned long omap243x_sram_ddr_init_sz;
69   -
70   -extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
71   - int bypass);
72   -extern unsigned long omap243x_sram_set_prcm_sz;
73   -
74   -extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
75   - u32 mem_type);
76   -extern unsigned long omap243x_sram_reprogram_sdrc_sz;
77   -
78   -extern u32 omap3_sram_configure_core_dpll(
79   - u32 m2, u32 unlock_dll, u32 f, u32 inc,
80   - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
81   - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
82   - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
83   - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
84   -extern unsigned long omap3_sram_configure_core_dpll_sz;
85   -
86   -#ifdef CONFIG_PM
87   -extern void omap_push_sram_idle(void);
88   -#else
89   -static inline void omap_push_sram_idle(void) {}
90   -#endif /* CONFIG_PM */
91   -
92   -#endif /* __ASSEMBLY__ */
93   -
94   -/*
95   - * OMAP2+: define the SRAM PA addresses.
96   - * Used by the SRAM management code and the idle sleep code.
97   - */
98   -#define OMAP2_SRAM_PA 0x40200000
99   -#define OMAP3_SRAM_PA 0x40200000
100   -#ifdef CONFIG_OMAP4_ERRATA_I688
101   -#define OMAP4_SRAM_PA 0x40304000
102   -#define OMAP4_SRAM_VA 0xfe404000
103   -#else
104   -#define OMAP4_SRAM_PA 0x40300000
105   -#endif
106   -#define AM33XX_SRAM_PA 0x40300000
107   -#endif