* [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support.
@ 2015-01-02 17:17 Nishanth Menon
2015-01-02 17:17 ` [PATCH 1/2] ARM: l2c: OMAP4/AM437x: Introduce support for cache latency programming Nishanth Menon
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Nishanth Menon @ 2015-01-02 17:17 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
OMAP4 and AM437x ROM code provides services to program PL310's latency
registers and AM437x provides service for programming Address filter
registers.
Provide support in the kernel for the same.
This provides some support to the series: http://marc.info/?l=linux-arm-kernel&m=141933190912495&w=2
Nishanth Menon (2):
ARM: l2c: OMAP4/AM437x: Introduce support for cache latency
programming
ARM: l2c: AM437x: Introduce support for cache filter programming
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/omap-secure.h | 2 ++
arch/arm/mach-omap2/omap-smc.S | 20 ++++++++++++++++++++
arch/arm/mach-omap2/omap4-common.c | 36 ++++++++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+)
Regards,
Nishanth Menon
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/2] ARM: l2c: OMAP4/AM437x: Introduce support for cache latency programming 2015-01-02 17:17 [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Nishanth Menon @ 2015-01-02 17:17 ` Nishanth Menon 2015-01-02 17:17 ` [PATCH 2/2] ARM: l2c: AM437x: Introduce support for cache filter programming Nishanth Menon 2015-01-02 17:38 ` [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Tony Lindgren 2 siblings, 0 replies; 7+ messages in thread From: Nishanth Menon @ 2015-01-02 17:17 UTC (permalink / raw) To: linux-arm-kernel OMAP4 and AM437x generations of processors support programming the PL310 L2Cache controller's Latency control registers using a secure montior call. Unfortunately, this varies from other PL310 programming sequence with a requirement of two parameters instead of the generic single parameter configuration. Information based on: OMAP4430 Public ROM Code API Functional Specfication revision 0.6 (Oct 27, 2010) OMAP4440 Public ROM Code API Functional Specfication revision 0.1 (Oct 27, 2010) Aegis ROM Code Memory and Peripheral Booting Functional Specification version 1.00 (Jan 1, 2014) Signed-off-by: Nishanth Menon <nm@ti.com> --- arch/arm/mach-omap2/common.h | 1 + arch/arm/mach-omap2/omap-secure.h | 1 + arch/arm/mach-omap2/omap-smc.S | 20 ++++++++++++++++++++ arch/arm/mach-omap2/omap4-common.c | 15 +++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 19c9144..d5f8a9c 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -240,6 +240,7 @@ extern void gic_dist_enable(void); extern bool gic_dist_disabled(void); extern void gic_timer_retrigger(void); extern void omap_smc1(u32 fn, u32 arg); +extern void omap_smc1_2(u32 fn, u32 arg1, u32 arg2); extern void __iomem *omap4_get_sar_ram_base(void); extern void omap_do_wfi(void); diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h index dec2b05..338fdab 100644 --- a/arch/arm/mach-omap2/omap-secure.h +++ b/arch/arm/mach-omap2/omap-secure.h @@ -42,6 +42,7 @@ #define OMAP4_MON_L2X0_DBG_CTRL_INDEX 0x100 #define OMAP4_MON_L2X0_CTRL_INDEX 0x102 #define OMAP4_MON_L2X0_AUXCTRL_INDEX 0x109 +#define OMAP4_MON_L2X0_SETLATENCY_INDEX 0x112 #define OMAP4_MON_L2X0_PREFETCH_INDEX 0x113 #define OMAP5_DRA7_MON_SET_CNTFRQ_INDEX 0x109 diff --git a/arch/arm/mach-omap2/omap-smc.S b/arch/arm/mach-omap2/omap-smc.S index fd90125..caf2bd1 100644 --- a/arch/arm/mach-omap2/omap-smc.S +++ b/arch/arm/mach-omap2/omap-smc.S @@ -33,6 +33,26 @@ ENTRY(omap_smc1) ldmfd sp!, {r2-r12, pc} ENDPROC(omap_smc1) +/* + * This is common routine to manage secure monitor API + * used to modify the PL310 secure registers. + * 'r0' and 'r1' contains the value to be modified and 'r12' contains + * the monitor API number. It uses few CPU registers + * internally and hence they need be backed up including + * link register "lr". + * Function signature : void omap_smc1_2(u32 fn, u32 arg1, u32 arg2) + */ + +ENTRY(omap_smc1_2) + stmfd sp!, {r2-r12, lr} + mov r12, r0 + mov r0, r1 + mov r1, r2 + dsb + smc #0 + ldmfd sp!, {r2-r12, pc} +ENDPROC(omap_smc1_2) + /** * u32 omap_smc2(u32 id, u32 falg, u32 pargs) * Low level common routine for secure HAL and PPA APIs. diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index fe99cef..25a0b2f 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -191,6 +191,21 @@ void omap4_l2c310_write_sec(unsigned long val, unsigned reg) pr_info_once("OMAP L2C310: ROM does not support power control setting\n"); return; + case L310_TAG_LATENCY_CTRL: + case L310_DATA_LATENCY_CTRL: + { + void __iomem *base = omap4_get_l2cache_base(); + u32 data_latency, tag_latency; + + tag_latency = (reg == L310_TAG_LATENCY_CTRL) ? val : + readl_relaxed(base + L310_TAG_LATENCY_CTRL); + data_latency = (reg == L310_DATA_LATENCY_CTRL) ? val : + readl_relaxed(base + L310_DATA_LATENCY_CTRL); + omap_smc1_2(OMAP4_MON_L2X0_SETLATENCY_INDEX, tag_latency, + data_latency); + return; + } + default: WARN_ONCE(1, "OMAP L2C310: ignoring write to reg 0x%x\n", reg); return; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: l2c: AM437x: Introduce support for cache filter programming 2015-01-02 17:17 [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Nishanth Menon 2015-01-02 17:17 ` [PATCH 1/2] ARM: l2c: OMAP4/AM437x: Introduce support for cache latency programming Nishanth Menon @ 2015-01-02 17:17 ` Nishanth Menon 2015-01-02 17:38 ` [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Tony Lindgren 2 siblings, 0 replies; 7+ messages in thread From: Nishanth Menon @ 2015-01-02 17:17 UTC (permalink / raw) To: linux-arm-kernel AM437x generation of processors support programming the PL310 L2Cache controller's address filter start and end registers using a secure montior service. Unfortunately, this secure monitor service is not supported on OMAP4 generation of processors. Information based on: OMAP4430 Public ROM Code API Functional Specfication revision 0.6 (Oct 27, 2010) OMAP4440 Public ROM Code API Functional Specfication revision 0.1 (Oct 27, 2010) Aegis ROM Code Memory and Peripheral Booting Functional Specification version 1.00 (Jan 1, 2014) Signed-off-by: Nishanth Menon <nm@ti.com> --- arch/arm/mach-omap2/omap-secure.h | 1 + arch/arm/mach-omap2/omap4-common.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h index 338fdab..569e167 100644 --- a/arch/arm/mach-omap2/omap-secure.h +++ b/arch/arm/mach-omap2/omap-secure.h @@ -44,6 +44,7 @@ #define OMAP4_MON_L2X0_AUXCTRL_INDEX 0x109 #define OMAP4_MON_L2X0_SETLATENCY_INDEX 0x112 #define OMAP4_MON_L2X0_PREFETCH_INDEX 0x113 +#define AM43X_MON_L2X0_SETFILTER_INDEX 0x114 #define OMAP5_DRA7_MON_SET_CNTFRQ_INDEX 0x109 #define OMAP5_MON_AMBA_IF_INDEX 0x108 diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 25a0b2f..041ba74 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -206,6 +206,27 @@ void omap4_l2c310_write_sec(unsigned long val, unsigned reg) return; } + case L310_ADDR_FILTER_START: + case L310_ADDR_FILTER_END: + { + void __iomem *base; + u32 filter_start, filter_end; + + if (!soc_is_am437x()) { + pr_info_once("OMAP L2C310: ROM does not support filter setting\n"); + return; + } + + base = omap4_get_l2cache_base(); + filter_start = (reg == L310_ADDR_FILTER_START) ? val : + readl_relaxed(base + L310_ADDR_FILTER_START); + filter_end = (reg == L310_ADDR_FILTER_END) ? val : + readl_relaxed(base + L310_ADDR_FILTER_END); + omap_smc1_2(AM43X_MON_L2X0_SETFILTER_INDEX, filter_end, + filter_start); + return; + } + default: WARN_ONCE(1, "OMAP L2C310: ignoring write to reg 0x%x\n", reg); return; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support. 2015-01-02 17:17 [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Nishanth Menon 2015-01-02 17:17 ` [PATCH 1/2] ARM: l2c: OMAP4/AM437x: Introduce support for cache latency programming Nishanth Menon 2015-01-02 17:17 ` [PATCH 2/2] ARM: l2c: AM437x: Introduce support for cache filter programming Nishanth Menon @ 2015-01-02 17:38 ` Tony Lindgren 2015-01-02 17:52 ` Nishanth Menon 2 siblings, 1 reply; 7+ messages in thread From: Tony Lindgren @ 2015-01-02 17:38 UTC (permalink / raw) To: linux-arm-kernel * Nishanth Menon <nm@ti.com> [150102 09:20]: > Hi, > > OMAP4 and AM437x ROM code provides services to program PL310's latency > registers and AM437x provides service for programming Address filter > registers. > > Provide support in the kernel for the same. > > This provides some support to the series: http://marc.info/?l=linux-arm-kernel&m=141933190912495&w=2 Are these to be applied before Thomasz's series as fixes? If we don't need these as fixes for the -rc, then probably makes sense for RMK to merge them all together for v3.20. Regards, Tony > Nishanth Menon (2): > ARM: l2c: OMAP4/AM437x: Introduce support for cache latency > programming > ARM: l2c: AM437x: Introduce support for cache filter programming > > arch/arm/mach-omap2/common.h | 1 + > arch/arm/mach-omap2/omap-secure.h | 2 ++ > arch/arm/mach-omap2/omap-smc.S | 20 ++++++++++++++++++++ > arch/arm/mach-omap2/omap4-common.c | 36 ++++++++++++++++++++++++++++++++++++ > 4 files changed, 59 insertions(+) > > Regards, > Nishanth Menon > > -- > 1.7.9.5 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support. 2015-01-02 17:38 ` [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Tony Lindgren @ 2015-01-02 17:52 ` Nishanth Menon 2015-01-19 21:28 ` Tony Lindgren 0 siblings, 1 reply; 7+ messages in thread From: Nishanth Menon @ 2015-01-02 17:52 UTC (permalink / raw) To: linux-arm-kernel On 01/02/2015 11:38 AM, Tony Lindgren wrote: > * Nishanth Menon <nm@ti.com> [150102 09:20]: >> Hi, >> >> OMAP4 and AM437x ROM code provides services to program PL310's latency >> registers and AM437x provides service for programming Address filter >> registers. >> >> Provide support in the kernel for the same. >> >> This provides some support to the series: http://marc.info/?l=linux-arm-kernel&m=141933190912495&w=2 > > Are these to be applied before Thomasz's series as fixes? If we > don't need these as fixes for the -rc, then probably makes sense > for RMK to merge them all together for v3.20. > These dont need to go in fixes. Can easily wait till 3.20. Thomaz series wont exercise these path by default until someone modifies the DT properties. Yes, will be nice to have them along with other changes in v3.20. just for the record, i made a couple of typos in v1 of this series and have updated a retested v2 of the series. -- Regards, Nishanth Menon ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support. 2015-01-02 17:52 ` Nishanth Menon @ 2015-01-19 21:28 ` Tony Lindgren 2015-01-19 21:32 ` Tony Lindgren 0 siblings, 1 reply; 7+ messages in thread From: Tony Lindgren @ 2015-01-19 21:28 UTC (permalink / raw) To: linux-arm-kernel * Nishanth Menon <nm@ti.com> [150102 09:55]: > On 01/02/2015 11:38 AM, Tony Lindgren wrote: > > * Nishanth Menon <nm@ti.com> [150102 09:20]: > >> Hi, > >> > >> OMAP4 and AM437x ROM code provides services to program PL310's latency > >> registers and AM437x provides service for programming Address filter > >> registers. > >> > >> Provide support in the kernel for the same. > >> > >> This provides some support to the series: http://marc.info/?l=linux-arm-kernel&m=141933190912495&w=2 > > > > Are these to be applied before Thomasz's series as fixes? If we > > don't need these as fixes for the -rc, then probably makes sense > > for RMK to merge them all together for v3.20. > > > These dont need to go in fixes. Can easily wait till 3.20. Thomaz > series wont exercise these path by default until someone modifies the > DT properties. Yes, will be nice to have them along with other changes > in v3.20. just for the record, i made a couple of typos in v1 of this > series and have updated a retested v2 of the series. Applying both int omap-for-v3.20/fixes thanks. Regards, Tony ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support. 2015-01-19 21:28 ` Tony Lindgren @ 2015-01-19 21:32 ` Tony Lindgren 0 siblings, 0 replies; 7+ messages in thread From: Tony Lindgren @ 2015-01-19 21:32 UTC (permalink / raw) To: linux-arm-kernel * Tony Lindgren <tony@atomide.com> [150119 13:35]: > * Nishanth Menon <nm@ti.com> [150102 09:55]: > > On 01/02/2015 11:38 AM, Tony Lindgren wrote: > > > * Nishanth Menon <nm@ti.com> [150102 09:20]: > > >> Hi, > > >> > > >> OMAP4 and AM437x ROM code provides services to program PL310's latency > > >> registers and AM437x provides service for programming Address filter > > >> registers. > > >> > > >> Provide support in the kernel for the same. > > >> > > >> This provides some support to the series: http://marc.info/?l=linux-arm-kernel&m=141933190912495&w=2 > > > > > > Are these to be applied before Thomasz's series as fixes? If we > > > don't need these as fixes for the -rc, then probably makes sense > > > for RMK to merge them all together for v3.20. > > > > > These dont need to go in fixes. Can easily wait till 3.20. Thomaz > > series wont exercise these path by default until someone modifies the > > DT properties. Yes, will be nice to have them along with other changes > > in v3.20. just for the record, i made a couple of typos in v1 of this > > series and have updated a retested v2 of the series. > > Applying both int omap-for-v3.20/fixes thanks. Oops actually not applying based on reading the comments in v2 of this series. Please repost if you still want to patch something. Regards, Tony ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-01-19 21:32 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-01-02 17:17 [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Nishanth Menon 2015-01-02 17:17 ` [PATCH 1/2] ARM: l2c: OMAP4/AM437x: Introduce support for cache latency programming Nishanth Menon 2015-01-02 17:17 ` [PATCH 2/2] ARM: l2c: AM437x: Introduce support for cache filter programming Nishanth Menon 2015-01-02 17:38 ` [PATCH 0/2] ARM: l2c: OMAP4/AM437x: Additional register programming support Tony Lindgren 2015-01-02 17:52 ` Nishanth Menon 2015-01-19 21:28 ` Tony Lindgren 2015-01-19 21:32 ` Tony Lindgren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).