Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+39 -55
+1 -2
arch/arm/mach-omap1/clock.c
··· 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;
+1 -2
arch/arm/mach-omap1/clock_data.c
··· 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
+1 -2
arch/arm/mach-omap1/devices.c
··· 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
+2 -2
arch/arm/mach-omap1/pm.c
··· 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> ··· 57 56 58 57 #include <mach/irqs.h> 59 58 60 - #include "../plat-omap/sram.h" 61 - 62 59 #include "iomap.h" 63 60 #include "clock.h" 64 61 #include "pm.h" 62 + #include "sram.h" 65 63 66 64 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 67 65 static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
+7
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;
+1 -2
arch/arm/mach-omap2/clkt2xxx_dpllcore.c
··· 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
+1 -2
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
··· 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" ··· 40 42 #include "cm2xxx_3xxx.h" 41 43 #include "cm-regbits-24xx.h" 42 44 #include "sdrc.h" 45 + #include "sram.h" 43 46 44 47 const struct prcm_config *curr_prcm_set; 45 48 const struct prcm_config *rate_table;
+1 -2
arch/arm/mach-omap2/clkt34xx_dpll3m2.c
··· 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
+1 -2
arch/arm/mach-omap2/io.c
··· 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" ··· 41 43 #include "omap-pm.h" 42 44 #include "sdrc.h" 43 45 #include "serial.h" 46 + #include "sram.h" 44 47 45 48 /* 46 49 * The machine specific code may provide the extra mapping besides the
-2
arch/arm/mach-omap2/omap4-common.c
··· 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"
+3 -2
arch/arm/mach-omap2/pm24xx.c
··· 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> 37 39 #include <asm/system_misc.h> 38 40 39 41 #include <plat-omap/dma-omap.h> 40 - 41 - #include "../plat-omap/sram.h" 42 42 43 43 #include "soc.h" 44 44 #include "common.h" ··· 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"
+2 -2
arch/arm/mach-omap2/pm34xx.c
··· 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 39 #include "powerdomain.h" 41 40 #include <plat/prcm.h> 42 41 #include <plat-omap/dma-omap.h> 43 - 44 - #include "../plat-omap/sram.h" 45 42 46 43 #include "soc.h" 47 44 #include "common.h" ··· 51 52 #include "prm2xxx_3xxx.h" 52 53 #include "pm.h" 53 54 #include "sdrc.h" 55 + #include "sram.h" 54 56 #include "control.h" 55 57 56 58 /* pm34xx errata defined in pm.h */
-2
arch/arm/mach-omap2/sdrc.c
··· 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"
+1 -2
arch/arm/mach-omap2/sdrc2xxx.c
··· 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
+1 -2
arch/arm/mach-omap2/sleep34xx.S
··· 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 /*
+12
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 + })
+3 -2
arch/arm/plat-omap/sram.c
··· 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"
+1 -25
arch/arm/plat-omap/sram.h arch/arm/mach-omap2/sram.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/sram.h 3 - * 4 2 * Interface for functions that need to be run in internal SRAM 5 3 * 6 4 * This program is free software; you can redistribute it and/or modify ··· 6 8 * published by the Free Software Foundation. 7 9 */ 8 10 9 - #ifndef __ARCH_ARM_OMAP_SRAM_H 10 - #define __ARCH_ARM_OMAP_SRAM_H 11 - 12 11 #ifndef __ASSEMBLY__ 13 - #include <asm/fncpy.h> 14 - 15 - int __init omap_sram_init(void); 16 - 17 - extern void *omap_sram_push_address(unsigned long size); 18 - 19 - /* Macro to push a function to the internal SRAM, using the fncpy API */ 20 - #define omap_sram_push(funcp, size) ({ \ 21 - typeof(&(funcp)) _res = NULL; \ 22 - void *_sram_address = omap_sram_push_address(size); \ 23 - if (_sram_address) \ 24 - _res = fncpy(_sram_address, &(funcp), size); \ 25 - _res; \ 26 - }) 27 - 28 - extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); 12 + #include <plat/sram.h> 29 13 30 14 extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 31 15 u32 base_cs, u32 force_unlock); ··· 24 44 extern void omap3_sram_restore_context(void); 25 45 26 46 /* Do not use these */ 27 - extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 28 - extern unsigned long omap1_sram_reprogram_clock_sz; 29 - 30 47 extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 31 48 extern unsigned long omap24xx_sram_reprogram_clock_sz; 32 49 ··· 81 104 #define OMAP4_SRAM_PA 0x40300000 82 105 #endif 83 106 #define AM33XX_SRAM_PA 0x40300000 84 - #endif