introduce generic OMAP SOC features
Subsystems (4)
v2 cover introduce generic OMAP SOC features
With OMAP4 we have the need to have SOC independent features handling. This makes sense from a long run as other OMAP4 derivatives gets generated in parallel to OMAP3 generation of chips.
V1: http://marc.info/?l=linux-omap&m=127458581708411&w=2
V2 incorporates additional patches which were posted as part of http://marc.info/?t=127357973500002&r=1&w=2
Example usages:
http://marc.info/?t=127376415000008&r=1&w=2 http://marc.info/?t=127265012000008&r=1&w=2
This series attempts to introduce a framework which could be used from OMAP1 onwards.
Caveat: this series just introduces the framework by reorganizing the existing data, it introduces just a basic support on OMAP1,2,4 while reorganizing the existing omap3 features as needed for OMAP1,2,3,4. As usual, comments are welcome.
NOTE: Tested on OMAP3430, 3630, OMAP4. Requesting help to verify on other platforms as well - OMAP1,2 etc..(only very limited change has been done for these, expectation is for them to continue to function).
Nishanth Menon (9):
omap1: rename check_revision
omap2/3: id: fix sparse warning
omap: generic: introduce a single check_revision
omap: improve OMAP3_HAS_FEATURE
omap: introduce OMAP_SHOW_FEATURE
omap: move generic omap3 features to generic
omap: introduce omap4 feature
omap: introduce omap24xx generic features
omap: id: add feature check for omap1
arch/arm/mach-omap1/id.c | 8 +++- arch/arm/mach-omap1/io.c | 1 - arch/arm/mach-omap2/id.c | 61 +++++++++++++++++++--------- arch/arm/mach-omap2/io.c | 2 +- arch/arm/plat-omap/common.c | 16 +++++++ arch/arm/plat-omap/include/plat/cpu.h | 72 ++++++++++++++++++++++----------- 6 files changed, 113 insertions(+), 47 deletions(-)
Regards,
Nishanth Menon
PATCH v2 7/9 omap: introduce omap4 feature
introduce basic omap4 feature framework
--- arch/arm/mach-omap2/id.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/id.c +14 -0
@@ -267,6 +267,19 @@ static void __init omap3_check_revision(void) } } +static void __init omap4_check_features (void ) +{ +/* +* TODO: add a better check feature once we have +* more decent feature check +*/ +if (cpu_is_omap4430 ()) + omap_features |=OMAP_HAS_L2CACHE | +OMAP_HAS_IVA | +OMAP_HAS_SGX | +OMAP_HAS_NEON ; +} +static void __init omap4_check_revision (void ) {u32 idcode;
@@ -382,6 +395,7 @@ void __init omap2_check_revision(void)return ; }else if (cpu_is_omap44xx ()) {omap4_check_revision (); +omap4_check_features ();return ; }else {pr_err ("OMAP revision unknown, please fix!\n" );
Signature · 1 line
1.6.3.3
PATCH v2 8/9 omap: introduce omap24xx generic features
In reply to Nishanth Menonintroduce generic features for omap2. omap2 uses mbx, not sgx, and it still has a dsp, though not iva2 as omap3 uses..
--- arch/arm/mach-omap2/id.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/id.c +11 -0
@@ -102,6 +102,16 @@ static struct omap_id omap_ids[] __initdata = {static void __iomem *tap_base;static u16 tap_prod_id; +static void __init omap24xx_check_features (void ) +{ +/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE | +OMAP_HAS_IVA ; +} +static void __init omap24xx_check_revision (void ) {int i, j;
@@ -388,6 +398,7 @@ void __init omap2_check_revision(void)*/ if (cpu_is_omap24xx ()) {omap24xx_check_revision (); +omap24xx_check_features (); }else if (cpu_is_omap34xx ()) {omap3_check_revision ();omap3_check_features ();
Signature · 1 line
1.6.3.3
PATCH v2 9/9 omap: id: add feature check for omap1
In reply to Nishanth Menonadd a minimalist feature - l2cache for omap1.
--- arch/arm/mach-omap1/id.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-omap1/id.c +6 -0
@@ -200,5 +200,11 @@ void __init omap1_check_revision(void)printk (KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n" , die_rev, omap_revision &0xff , system_serial_low, system_serial_high); + +/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE ; }
Signature · 1 line
1.6.3.3
PATCH v2 4/9 omap: improve OMAP3_HAS_FEATURE
In reply to Nishanth MenonReplace OMAP3_HAS_FEATURE with OMAP_HAS_FEATURE allowing us to support multiple chip features
--- arch/arm/plat-omap/include/plat/cpu.h | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
arch/arm/plat-omap/include/plat/cpu.h +12 -12
@@ -444,6 +444,12 @@ static inline void omap1_check_revision(void) {}#endif void omap_check_revision (void ); +#define OMAP_HAS_FEATURE (rev, feat, flag) \ +static inline unsigned int omap##rev##_has_ ##feat(void) \ +{ \ + return omap##rev##_features & OMAP##rev##_HAS_ ##flag; \ +} \ +/* * Runtime detection of OMAP3 features */
@@ -456,17 +462,11 @@ extern u32 omap3_features;#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5) -#define OMAP3_HAS_FEATURE (feat,flag) \ -static inline unsigned int omap3_has_ ##feat(void) \ -{ \ - return (omap3_features & OMAP3_HAS_ ##flag); \ -} \ - -OMAP3_HAS_FEATURE(l2cache, L2CACHE) -OMAP3_HAS_FEATURE(sgx, SGX) -OMAP3_HAS_FEATURE(iva, IVA) -OMAP3_HAS_FEATURE(neon, NEON) -OMAP3_HAS_FEATURE(isp, ISP) -OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) +OMAP_HAS_FEATURE(3, l2cache, L2CACHE) +OMAP_HAS_FEATURE(3, sgx, SGX) +OMAP_HAS_FEATURE(3, iva, IVA) +OMAP_HAS_FEATURE(3, neon, NEON) +OMAP_HAS_FEATURE(3, isp, ISP) +OMAP_HAS_FEATURE(3, 192mhz_clk, 192MHZ_CLK)#endif
Signature · 1 line
1.6.3.3
PATCH v2 3/9 omap: generic: introduce a single check_revision
In reply to Nishanth MenonIntroduce a single omap generic check_revision that routes the request to the right revision of check_revision.
--- arch/arm/mach-omap1/io.c | 3 +-- arch/arm/mach-omap2/io.c | 2 +- arch/arm/plat-omap/common.c | 12 ++++++++++++ arch/arm/plat-omap/include/plat/cpu.h | 13 ++++++++++++- 4 files changed, 26 insertions(+), 4 deletions(-)
arch/arm/mach-omap1/io.c +1 -2
@@ -20,7 +20,6 @@#include "clock.h" -extern void omap1_check_revision (void );extern void omap_sram_init (void );/*
@@ -102,7 +101,7 @@ void __init omap1_map_common_io(void)/* We want to check CPU revision early for cpu_is_omapxxxx() macros. * IO space mapping must be initialized before we can do that. */ -omap1_check_revision (); +omap_check_revision ();#if defined (CONFIG_ARCH_OMAP730 ) || defined (CONFIG_ARCH_OMAP850 )if (cpu_is_omap7xx ()) {
arch/arm/mach-omap2/io.c +1 -1
@@ -238,7 +238,7 @@ static void __init _omap2_map_common_io(void)local_flush_tlb_all ();flush_cache_all (); -omap2_check_revision (); +omap_check_revision ();omap_sram_init (); }
arch/arm/plat-omap/common.c +12 -0
@@ -89,6 +89,18 @@ void __init omap_reserve(void)omap_vram_reserve_sdram_lmb (); } +void __init omap_check_revision () +{ +#ifdef CONFIG_ARCH_OMAP1 +if (cpu_is_omap7xx () ||cpu_is_omap15xx () ||cpu_is_omap16xx ()) +omap1_check_revision (); +#endif +#ifdef CONFIG_ARCH_OMAP2PLUS +if (cpu_is_omap24xx () ||cpu_is_omap34xx () ||cpu_is_omap44xx ()) +omap2_check_revision (); +#endif +} +/* * 32KHz clocksource ... always available, on pretty most chips except * OMAP 730 and 1510. Other timers could be used as clocksources, with
arch/arm/plat-omap/include/plat/cpu.h +12 -1
@@ -431,7 +431,18 @@ IS_OMAP_TYPE(3517, 0x3517)int omap_chip_is (struct omap_chip_id oci); -void omap2_check_revision (void ); +#ifdef CONFIG_ARCH_OMAP2PLUS +extern void omap2_check_revision (void ); +#else +static inline void omap2_check_revision (void ) {} +#endif + +#ifdef CONFIG_ARCH_OMAP1 +extern void omap1_check_revision (void ); +#else +static inline void omap1_check_revision (void ) {} +#endif +void omap_check_revision (void );/* * Runtime detection of OMAP3 features
Signature · 1 line
1.6.3.3
PATCH v2 5/9 omap: introduce OMAP_SHOW_FEATURE
In reply to Nishanth Menonchange OMAP3_SHOW_FEATURE into OMAP_SHOW_FEATURE to make the usage generic.
--- arch/arm/mach-omap2/id.c | 16 ++++++---------- arch/arm/plat-omap/include/plat/cpu.h | 6 ++++++ 2 files changed, 12 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/id.c +6 -10
@@ -293,10 +293,6 @@ static void __init omap4_check_revision(void)pr_err ("Unknown OMAP4 CPU id\n" ); } -#define OMAP3_SHOW_FEATURE (feat) \ - if (omap3_has_ ##feat()) \ - printk(#feat" "); -static void __init omap3_cpuinfo (void ) {u8 rev =GET_OMAP_REVISION ();
@@ -358,12 +354,12 @@ static void __init omap3_cpuinfo(void)/* Print verbose information */ pr_info ("%s ES%s (" , cpu_name, cpu_rev); -OMAP3_SHOW_FEATURE (l2cache); -OMAP3_SHOW_FEATURE (iva); -OMAP3_SHOW_FEATURE (sgx); -OMAP3_SHOW_FEATURE (neon); -OMAP3_SHOW_FEATURE (isp); - OMAP3_SHOW_FEATURE(192mhz_clk); +OMAP_SHOW_FEATURE (3 , l2cache); +OMAP_SHOW_FEATURE (3 , iva); +OMAP_SHOW_FEATURE (3 , sgx); +OMAP_SHOW_FEATURE (3 , neon); +OMAP_SHOW_FEATURE (3 , isp); + OMAP_SHOW_FEATURE(3, 192mhz_clk);printk (")\n" ); }
arch/arm/plat-omap/include/plat/cpu.h +6 -0
@@ -450,6 +450,12 @@ static inline unsigned int omap##rev##_has_ ##feat(void) \ return omap##rev##_features & OMAP##rev##_HAS_ ##flag; \ } \ +#define OMAP_SHOW_FEATURE (rev, feat) \ +{ \ + if (omap##rev##_has_ ##feat()) \ + printk(#feat" "); \ +} \ +/* * Runtime detection of OMAP3 features */
Signature · 1 line
1.6.3.3
PATCH v2 2/9 omap2/3: id: fix sparse warning
In reply to Nishanth Menonomap24xx_check_revision, omap3_check_features, omap3_check_revision, omap4_check_revision, omap3_cpuinfo are not used elsewhere, it should be static
Also fixes the following sparse warnings:arch/arm/mach-omap2/id.c:105:13: warning: symbol 'omap24xx_check_revision' was not declared. Should it be static? arch/arm/mach-omap2/id.c:167:13: warning: symbol 'omap3_check_features' was not declared. Should it be static? arch/arm/mach-omap2/id.c:189:13: warning: symbol 'omap3_check_revision' was not declared. Should it be static? arch/arm/mach-omap2/id.c:270:13: warning: symbol 'omap4_check_revision' was not declared. Should it be static? arch/arm/mach-omap2/id.c:300:13: warning: symbol 'omap3_cpuinfo' was not declared. Should it be static?
--- arch/arm/mach-omap2/id.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/id.c +5 -5
@@ -102,7 +102,7 @@ static struct omap_id omap_ids[] __initdata = {static void __iomem *tap_base;static u16 tap_prod_id; -void __init omap24xx_check_revision (void ) +static void __init omap24xx_check_revision (void ) {int i, j;u32 idcode, prod_id;
@@ -164,7 +164,7 @@ void __init omap24xx_check_revision(void) omap3_features |= OMAP3_HAS_ ##feat; \ } -void __init omap3_check_features (void ) +static void __init omap3_check_features (void ) {u32 status;
@@ -186,7 +186,7 @@ void __init omap3_check_features(void)*/ } -void __init omap3_check_revision (void ) +static void __init omap3_check_revision (void ) {u32 cpuid, idcode;u16 hawkeye;
@@ -267,7 +267,7 @@ void __init omap3_check_revision(void) } } -void __init omap4_check_revision (void ) +static void __init omap4_check_revision (void ) {u32 idcode;u16 hawkeye;
@@ -297,7 +297,7 @@ void __init omap4_check_revision(void) if (omap3_has_ ##feat()) \ printk(#feat" "); -void __init omap3_cpuinfo (void ) +static void __init omap3_cpuinfo (void ) {u8 rev =GET_OMAP_REVISION ();char cpu_name[16 ], cpu_rev[16 ];
Signature · 1 line
1.6.3.3
PATCH v2 1/9 omap1: rename check_revision
In reply to Nishanth MenonRename omap_check_revision to omap1_check_revision to make it evident that this is omap1 features to check. This will allow us to introduce a omap generic check feature capability
--- arch/arm/mach-omap1/id.c | 2 +- arch/arm/mach-omap1/io.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap1/id.c +1 -1
@@ -118,7 +118,7 @@ static u8 __init omap_get_die_rev(void)return die_rev; } -void __init omap_check_revision (void ) +void __init omap1_check_revision (void ) {int i;u16 jtag_id;
arch/arm/mach-omap1/io.c +2 -2
@@ -20,7 +20,7 @@#include "clock.h" -extern void omap_check_revision (void ); +extern void omap1_check_revision (void );extern void omap_sram_init (void );/*
@@ -102,7 +102,7 @@ void __init omap1_map_common_io(void)/* We want to check CPU revision early for cpu_is_omapxxxx() macros. * IO space mapping must be initialized before we can do that. */ -omap_check_revision (); +omap1_check_revision ();#if defined (CONFIG_ARCH_OMAP730 ) || defined (CONFIG_ARCH_OMAP850 )if (cpu_is_omap7xx ()) {
Signature · 1 line
1.6.3.3
PATCH v2 6/9 omap: move generic omap3 features to generic
In reply to Nishanth Menonsgx, iva, l2cache, sgx, neon, isp are generic features, make them generic features, current OMAP3 detection mechanism is still retained. 192Mhz is more specific OMAP3 feature so it is retained as is
--- arch/arm/mach-omap2/id.c | 20 ++++++++-------- arch/arm/plat-omap/common.c | 4 +++ arch/arm/plat-omap/include/plat/cpu.h | 39 +++++++++++++++++++------------- 3 files changed, 37 insertions(+), 26 deletions(-)
arch/arm/mach-omap2/id.c +10 -10
@@ -161,7 +161,7 @@ static void __init omap24xx_check_revision(void)#define OMAP3_CHECK_FEATURE (status,feat) \ if (((status & OMAP3_ ##feat## _MASK) \ >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \ - omap3_features |= OMAP3_HAS_ ##feat; \ + omap_features |= OMAP_HAS_ ##feat; \ }static void __init omap3_check_features (void )
@@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void)/* * AM35xx devices */ -if (omap3_has_sgx ()) { +if (omap_has_sgx ()) { omap_revision =OMAP3517_REV (rev);strcpy (cpu_name,"AM3517" ); }else {/* Already set in omap3_check_revision() */ strcpy (cpu_name,"AM3505" ); } - }else if (omap3_has_iva () &&omap3_has_sgx ()) { + }else if (omap_has_iva () &&omap_has_sgx ()) {/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ strcpy (cpu_name,"OMAP3430/3530" ); - }else if (omap3_has_iva ()) { + }else if (omap_has_iva ()) { omap_revision =OMAP3525_REV (rev);strcpy (cpu_name,"OMAP3525" ); - }else if (omap3_has_sgx ()) { + }else if (omap_has_sgx ()) { omap_revision =OMAP3515_REV (rev);strcpy (cpu_name,"OMAP3515" ); }else {
@@ -354,11 +354,11 @@ static void __init omap3_cpuinfo(void)/* Print verbose information */ pr_info ("%s ES%s (" , cpu_name, cpu_rev); -OMAP_SHOW_FEATURE (3 , l2cache); -OMAP_SHOW_FEATURE (3 , iva); -OMAP_SHOW_FEATURE (3 , sgx); -OMAP_SHOW_FEATURE (3 , neon); -OMAP_SHOW_FEATURE (3 , isp); + OMAP_SHOW_FEATURE(, l2cache); + OMAP_SHOW_FEATURE(, iva); + OMAP_SHOW_FEATURE(, sgx); + OMAP_SHOW_FEATURE(, neon); + OMAP_SHOW_FEATURE(, isp); OMAP_SHOW_FEATURE(3, 192mhz_clk);printk (")\n" );
arch/arm/plat-omap/common.c +4 -0
@@ -89,6 +89,10 @@ void __init omap_reserve(void)omap_vram_reserve_sdram_lmb (); } +/* OMAP Generic features */ +u32 omap_features; +EXPORT_SYMBOL (omap_features); +void __init omap_check_revision () {#ifdef CONFIG_ARCH_OMAP1
arch/arm/plat-omap/include/plat/cpu.h +23 -16
@@ -331,14 +331,14 @@ IS_OMAP_TYPE(3517, 0x3517)# undef cpu_is_omap3517# define cpu_is_omap3430 () is_omap3430()# define cpu_is_omap3503 () (cpu_is_omap3430() && \ - (!omap3_has_iva()) && \ - (!omap3_has_sgx())) + (!omap_has_iva()) && \ + (!omap_has_sgx()))# define cpu_is_omap3515 () (cpu_is_omap3430() && \ - (!omap3_has_iva()) && \ - (omap3_has_sgx())) + (!omap_has_iva()) && \ + (omap_has_sgx()))# define cpu_is_omap3525 () (cpu_is_omap3430() && \ - (!omap3_has_sgx()) && \ - (omap3_has_iva())) + (!omap_has_sgx()) && \ + (omap_has_iva()))# define cpu_is_omap3530 () (cpu_is_omap3430())# define cpu_is_omap3505 () is_omap3505()# define cpu_is_omap3517 () is_omap3517()
@@ -457,22 +457,29 @@ static inline unsigned int omap##rev##_has_ ##feat(void) \ } \/* +* Runtime detection of Generic OMAP features +*/ +extern u32 omap_features; + +#define OMAP_HAS_L2CACHE BIT(0) +#define OMAP_HAS_IVA BIT(1) +#define OMAP_HAS_SGX BIT(2) +#define OMAP_HAS_NEON BIT(3) +#define OMAP_HAS_ISP BIT(4) + +OMAP_HAS_FEATURE(, l2cache, L2CACHE) +OMAP_HAS_FEATURE(, sgx, SGX) +OMAP_HAS_FEATURE(, iva, IVA) +OMAP_HAS_FEATURE(, neon, NEON) +OMAP_HAS_FEATURE(, isp, ISP) + +/* * Runtime detection of OMAP3 features */ extern u32 omap3_features; -#define OMAP3_HAS_L2CACHE BIT(0) -#define OMAP3_HAS_IVA BIT(1) -#define OMAP3_HAS_SGX BIT(2) -#define OMAP3_HAS_NEON BIT(3) -#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5) -OMAP_HAS_FEATURE(3, l2cache, L2CACHE) -OMAP_HAS_FEATURE(3, sgx, SGX) -OMAP_HAS_FEATURE(3, iva, IVA) -OMAP_HAS_FEATURE(3, neon, NEON) -OMAP_HAS_FEATURE(3, isp, ISP) OMAP_HAS_FEATURE(3, 192mhz_clk, 192MHZ_CLK)#endif
Signature · 1 line
1.6.3.3
Re: [PATCH 3/9] omap: generic: introduce a single check_revision
In reply to Nishanth MenonQuoted 26 lines · Nishanth Menon
Introduce a single omap generic
check_revisionthat routes the request to the right revision ofcheck_revision.Cc Tony Lindgren <[email protected]>Cc Angelo Arrifano <[email protected]>Cc "Zebediah C. McClure" <[email protected]>Cc Alistair Buxton <[email protected]>Cc Paul Walmsley <[email protected]>Cc Sanjeev Premi <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Senthilvadivu Gurusamy <[email protected]>Cc Kevin Hilman <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Aaro Koskinen <[email protected]>Cc Vikram Pandita <[email protected]>Cc Vishwanath S <[email protected]>Signed-off-by Nishanth Menon <[email protected]>---
arch/arm/mach-omap1/io.c | 3 +--arch/arm/mach-omap2/io.c| 2 +-arch/arm/plat-omap/common.c| 12 ++++++++++++arch/arm/plat-omap/include/plat/cpu.h| 13 ++++++++++++-4 files changed, 26 insertions(+), 4 deletions(-)
<snip>
arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 92
Quoted 9 lines
arch/arm/plat-omap/common.c +1
-0@@ -89,6 +89,18 @@ void __init omap_reserve(void) omap_vram_reserve_sdram_lmb(); } +void __init omap_check_revision ()
minor nitpick:
void __init omap_check_revision(void)?
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/9] omap: generic: introduce a single check_revision
Grazvydas Ignotas had written, on 06/25/2010 04:31 AM, the following:
Quoted 3 lines · Nishanth Menon
Quoted 2 lines
Introduce a single omap generic
check_revisionthat routes the request to the right revision ofcheck_revision.
[...]
Quoted 9 lines
Quoted 9 lines
arch/arm/plat-omap/common.c +0
-0@@ -89,6 +89,18 @@ void __init omap_reserve(void)omap_vram_reserve_sdram_lmb (); }
Quoted 4 lines
arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 92
Quoted 1 line
arch/arm/plat-omap/common.c +1
-0+void __init omap_check_revision ()minor nitpick:
void__initomap_check_revision(void)?
ack. thanks for catching this.
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 9/9] omap: id: add feature check for omap1
In reply to Nishanth MenonQuoted 12 lines · Nishanth Menon
add a minimalist feature - l2cache for omap1.
Signed-off-by Nishanth Menon <[email protected]>--- arch/arm/mach-omap1/id.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-omap1/id.c +0
-0
arch/arm/mach-omap1/id.c void __init omap1_check_revision(void) · line 209
Quoted 10 lines
arch/arm/mach-omap1/id.c +6
-0@@ -200,5 +200,11 @@ void __init omap1_check_revision(void)printk (KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n" , die_rev, omap_revision &0xff , system_serial_low, system_serial_high); + +/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE ; }
There's no L2 cache on omap1?
Tony
Re: [PATCH 9/9] omap: id: add feature check for omap1
Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Nishanth Menon
add a minimalist feature - l2cache for omap1.
Signed-off-by Nishanth Menon<[email protected]>--- arch/arm/mach-omap1/id.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-omap1/id.c +1
-0@@ -200,5 +200,11 @@ void __init omap1_check_revision(void)printk (KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n" , die_rev, omap_revision&0xff , system_serial_low, system_serial_high); +
Quoted 8 lines
arch/arm/mach-omap1/id.c void __init omap1_check_revision(void) · line 209
Quoted 6 lines
arch/arm/mach-omap1/id.c +5
-0+/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE ; }There's no L2 cache on omap1?
I thought it did, hence added.. am I wrong?
Regards,
Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 9/9] omap: id: add feature check for omap1
Quoted 27 lines · Nishanth Menon
Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Nishanth Menon
add a minimalist feature - l2cache for omap1.
Signed-off-by Nishanth Menon<[email protected]>--- arch/arm/mach-omap1/id.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-omap1/id.c +1
-0@@ -200,5 +200,11 @@ void __init omap1_check_revision(void)printk (KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n" , die_rev, omap_revision&0xff , system_serial_low, system_serial_high); +Quoted 8 lines
arch/arm/mach-omap1/id.c void __init omap1_check_revision(void) · line 209
Quoted 6 lines
arch/arm/mach-omap1/id.c +5
-0+/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE ; }There's no L2 cache on omap1?
Quoted 1 line
I thought it did, hence added.. am I wrong?
Maybe you're thinking something else.. But for example, 1710 TRM says:
ARM926EJ
L1 32K-byte, four-way set-associative instruction cache L1 16K-byte, four-way set-associative data cache with write buffer
Then 2430 TRM says:
ARM1136JF-S
32K-byte instructions and 32K-byte data--4-way associative 64-entry instruction and 64-entry data memory management units (MMUs)
So no L2 until 34xx I believe.
Regards,
Tony
Re: [PATCH 9/9] omap: id: add feature check for omap1
Tony Lindgren had written, on 07/06/2010 08:14 AM, the following:
Quoted 40 lines · Nishanth Menon
Quoted 25 lines · Tony Lindgren
Quoted 8 lines · Nishanth Menon
Quoted 7 lines
add a minimalist feature - l2cache for omap1.
Signed-off-by Nishanth Menon<[email protected]>--- arch/arm/mach-omap1/id.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)Quoted 16 lines
Quoted 5 lines
arch/arm/mach-omap1/id.c +0
-0arch/arm/mach-omap1/id.c void __init omap1_check_revision(void) · line 209
Quoted 10 lines
arch/arm/mach-omap1/id.c +6
-0@@ -200,5 +200,11 @@ void __init omap1_check_revision(void)printk (KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n" , die_rev, omap_revision&0xff , system_serial_low, system_serial_high); + +/* +* TODO: add a better check feature once we have +* more decent feature check +*/ + omap_features |=OMAP_HAS_L2CACHE ; }There's no L2 cache on omap1?
Quoted 1 line
I thought it did, hence added.. am I wrong?
Maybe you're thinking something else.. But for example, 1710 TRM says:
ARM926EJ
L1 32K-byte, four-way set-associative instruction cache L1 16K-byte, four-way set-associative data cache with write bufferThen 2430 TRM says:
ARM1136JF-S
32K-byte instructions and 32K-byte data--4-way associative 64-entry instruction and 64-entry data memory management units (MMUs)
Quoted 5 lines
So no L2 until 34xx I believe.
Regards,
Tony
Arrgh.. my bad. you are right.
here is a bigger list I just checked internally with TRMs
1510 - TI925T - no L2.
A separate 16K-byte instruction cache and 8K-byte data cache. Both are
two-way associative with virtual index virtual tag (VIVT)
1610 - ARM926EJ
L1 16K-byte, four-way set-associative instruction cache L1 8K-byte, four-way set-associative data cache with write buffer
1710 - ARM926EJ
L1 32K-byte, four-way set-associative instruction cache L1 16K-byte, four-way set-associative data cache with write buffer
2420 (2.3) - ARM1136JF-S
– 32-KB instruction and 32-KB data; 4-way set associative memory
management units (MMUs)
– 64-entry instruction and 64-entry data write buffer
2430 (2.1) -
– 32K-byte instructions and 32K-byte data—4-way associative
– 64-entry instruction and 64-entry data memory management units (MMUs)
Please drop 9/9, and I will post a new revision of 8/9 without L2 enabled.
Signature · 6 lines
Regards, Nishanth Menon -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 4/9] omap: improve OMAP3_HAS_FEATURE
In reply to Nishanth MenonQuoted 52 lines · Nishanth Menon
Replace
OMAP3_HAS_FEATUREwithOMAP_HAS_FEATUREallowing us to support multiple chip featuresCc Tony Lindgren <[email protected]>Cc Angelo Arrifano <[email protected]>Cc "Zebediah C. McClure" <[email protected]>Cc Alistair Buxton <[email protected]>Cc Paul Walmsley <[email protected]>Cc Sanjeev Premi <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Senthilvadivu Gurusamy <[email protected]>Cc Kevin Hilman <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Aaro Koskinen <[email protected]>Cc Vikram Pandita <[email protected]>Cc Vishwanath S <[email protected]>Signed-off-by Nishanth Menon <[email protected]>--- arch/arm/plat-omap/include/plat/cpu.h | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)arch/arm/plat-omap/include/plat/cpu.h +6
-8@@ -444,6 +444,12 @@ static inline void omap1_check_revision(void) {}#endif void omap_check_revision (void ); +#define OMAP_HAS_FEATURE (rev, feat, flag) \ +static inline unsigned int omap##rev##_has_ ##feat(void) \ +{ \ + return omap##rev##_features & OMAP##rev##_HAS_ ##flag; \ +} \ +/* * Runtime detection of OMAP3 features */ @@ -456,17 +462,11 @@ extern u32 omap3_features;#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5) -#define OMAP3_HAS_FEATURE (feat,flag) \ -static inline unsigned int omap3_has_ ##feat(void) \ -{ \ - return (omap3_features & OMAP3_HAS_ ##flag); \ -} \ - -OMAP3_HAS_FEATURE(l2cache, L2CACHE) -OMAP3_HAS_FEATURE (sgx,SGX )
arch/arm/plat-omap/include/plat/cpu.h extern u32 omap3_features; · line 470
Quoted 10 lines
arch/arm/plat-omap/include/plat/cpu.h +6
-4-OMAP3_HAS_FEATURE(iva, IVA) -OMAP3_HAS_FEATURE(neon, NEON) -OMAP3_HAS_FEATURE(isp, ISP) -OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) +OMAP_HAS_FEATURE(3, l2cache, L2CACHE) +OMAP_HAS_FEATURE(3, sgx, SGX) +OMAP_HAS_FEATURE(3, iva, IVA) +OMAP_HAS_FEATURE(3, neon, NEON) +OMAP_HAS_FEATURE(3, isp, ISP) +OMAP_HAS_FEATURE(3, 192mhz_clk, 192MHZ_CLK)
Why don't you just rename u32 omap3_features to omap_features?
Then maybe move omap_features to plat-omap/common.c, and have a generic function for getting features?
There should not be any need to have separate features variable for each omap.
Tony
Tony Lindgren
maintainerRe: [PATCH 6/9] omap: move generic omap3 features to generic
In reply to Nishanth MenonQuoted 5 lines · Nishanth Menon
arch/arm/mach-omap2/id.c +0
-1@@ -354,11 +354,11 @@ static void __init omap3_cpuinfo(void)/* Print verbose information */ pr_info ("%s ES%s (" , cpu_name, cpu_rev); -OMAP_SHOW_FEATURE (3 , l2cache);
arch/arm/mach-omap2/id.c static void __init omap3_cpuinfo(void) · line 362
Quoted 10 lines
arch/arm/mach-omap2/id.c +5
-4-OMAP_SHOW_FEATURE (3 , iva); -OMAP_SHOW_FEATURE (3 , sgx); -OMAP_SHOW_FEATURE (3 , neon); -OMAP_SHOW_FEATURE (3 , isp); + OMAP_SHOW_FEATURE(, l2cache); + OMAP_SHOW_FEATURE(, iva); + OMAP_SHOW_FEATURE(, sgx); + OMAP_SHOW_FEATURE(, neon); + OMAP_SHOW_FEATURE(, isp); OMAP_SHOW_FEATURE(3, 192mhz_clk);
Then you can simplify OMAP_SHOW_FEATURE too as
the "3, " should not be needed?
Tony
Re: [PATCH 4/9] omap: improve OMAP3_HAS_FEATURE
In reply to Tony LindgrenTony Lindgren had written, on 07/07/2010 07:28 AM, the following:
Quoted 66 lines · Nishanth Menon
Quoted 52 lines
Replace
OMAP3_HAS_FEATUREwithOMAP_HAS_FEATUREallowing us to support multiple chip featuresCc Tony Lindgren <[email protected]>Cc Angelo Arrifano <[email protected]>Cc "Zebediah C. McClure" <[email protected]>Cc Alistair Buxton <[email protected]>Cc Paul Walmsley <[email protected]>Cc Sanjeev Premi <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Senthilvadivu Gurusamy <[email protected]>Cc Kevin Hilman <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Aaro Koskinen <[email protected]>Cc Vikram Pandita <[email protected]>Cc Vishwanath S <[email protected]>Signed-off-by Nishanth Menon <[email protected]>--- arch/arm/plat-omap/include/plat/cpu.h | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)arch/arm/plat-omap/include/plat/cpu.h +6
-8@@ -444,6 +444,12 @@ static inline void omap1_check_revision(void) {}#endif void omap_check_revision (void ); +#define OMAP_HAS_FEATURE (rev, feat, flag) \ +static inline unsigned int omap##rev##_has_ ##feat(void) \ +{ \ + return omap##rev##_features & OMAP##rev##_HAS_ ##flag; \ +} \ +/* * Runtime detection of OMAP3 features */ @@ -456,17 +462,11 @@ extern u32 omap3_features;#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5) -#define OMAP3_HAS_FEATURE (feat,flag) \ -static inline unsigned int omap3_has_ ##feat(void) \ -{ \ - return (omap3_features & OMAP3_HAS_ ##flag); \ -} \ - -OMAP3_HAS_FEATURE(l2cache, L2CACHE) -OMAP3_HAS_FEATURE (sgx,SGX )arch/arm/plat-omap/include/plat/cpu.h extern u32 omap3_features; · line 470
Quoted 10 lines
arch/arm/plat-omap/include/plat/cpu.h +6
-4-OMAP3_HAS_FEATURE(iva, IVA) -OMAP3_HAS_FEATURE(neon, NEON) -OMAP3_HAS_FEATURE(isp, ISP) -OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) +OMAP_HAS_FEATURE(3, l2cache, L2CACHE) +OMAP_HAS_FEATURE(3, sgx, SGX) +OMAP_HAS_FEATURE(3, iva, IVA) +OMAP_HAS_FEATURE(3, neon, NEON) +OMAP_HAS_FEATURE(3, isp, ISP) +OMAP_HAS_FEATURE(3, 192mhz_clk, 192MHZ_CLK)Why don't you just rename u32
omap3_featurestoomap_features?
Quoted 5 lines
Then maybe move
omap_featurestoplat-omap/common.c, and have a generic function for getting features?There should not be any need to have separate features variable for each omap.
192Mhz_clk is a OMAP3 only feature(differentiator b/w omap3430,35xx and 3630, 37xx).
overall, we will face this in the future. there are OMAP generic features and OMAP family specific features. currently OMAP3 has 34xx, 35xx series and 3630 and 37xx series. in future we may see similar things for OMAP4+ as well.. we need a differentiator when it comes to omap3 specific features Vs omap generic feature.
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 4/9] omap: improve OMAP3_HAS_FEATURE
Quoted 10 lines · Nishanth Menon
Quoted 8 lines
Why don't you just rename u32
omap3_featurestoomap_features?Then maybe move
omap_featurestoplat-omap/common.c, and have a generic function for getting features?There should not be any need to have separate features variable for each omap.
192Mhz_clk is a OMAP3 only
feature(differentiator b/w omap3430,35xx and 3630, 37xx).
Hmm, maybe it should be defined as l3_max_clk or similar instead?
Quoted 5 lines
overall, we will face this in the future. there are OMAP generic features and OMAP family specific features. currently OMAP3 has 34xx, 35xx series and 3630 and 37xx series. in future we may see similar things for OMAP4+ as well.. we need a differentiator when it comes to omap3 specific features Vs omap generic feature.
Sounds it will get more complex.. We should probably set it up with something like this then:
#define FEAT_MPU_L2_OUTER BIT(1)
#define FEAT_MPU_L2 BIT(0)
...
#define FEAT_IVA2 BIT(1)
#define FEAT_IVA BIT(0)
...
#define FEAT_L3_192 BIT(0)
...
struct omap_feature {
u32 mpu; /* MPU features */
u32 iva; /* IVA features */
u32 l3_max_clk;
...
};Regards,
Tony
Re: [PATCH 4/9] omap: improve OMAP3_HAS_FEATURE
Tony Lindgren had written, on 07/07/2010 08:30 AM, the following:
Quoted 6 lines · Nishanth Menon
Quoted 5 lines
Quoted 5 lines
Why don't you just rename u32
omap3_featurestoomap_features?Then maybe move
omap_featurestoplat-omap/common.c, and have a generic function for getting features?
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
There should not be any need to have separate features variable for each omap.
192Mhz_clk is a OMAP3 only
feature(differentiator b/w omap3430,35xx and 3630, 37xx).Hmm, maybe it should be defined as
l3_max_clkor similar instead?
it was meant as special feature of DPLL4 as i recollect Reference:
http://marc.info/?t=126578936600005&r=1&w=2
Quoted 21 lines
Quoted 6 lines
overall, we will face this in the future. there are OMAP generic features and OMAP family specific features. currently OMAP3 has 34xx, 35xx series and 3630 and 37xx series. in future we may see similar things for OMAP4+ as well.. we need a differentiator when it comes to omap3 specific features Vs omap generic feature.
Sounds it will get more complex.. We should probably set it up with something like this then:
#define
FEAT_MPU_L2_OUTERBIT(1)
#defineFEAT_MPU_L2BIT(0)
...#define
FEAT_IVA2BIT(1)
#defineFEAT_IVABIT(0)
...#define
FEAT_L3_192BIT(0)
...
Quoted 6 lines
struct omap_feature {
u32 mpu; /* MPU features */
u32 iva; /* IVA features */
u32 l3_max_clk;
...
};I think I understand your intent here is to introduce per IP based feature - that is really not necessary yet (we dont really have a usecase needing this level of complexity yet). it will be a natural evolution when we need to have such a feature handling.
currently a need for errata handling per ip is required, and we have a mechanism (quirks) to handle it on a IP basis. here the intent was to identify OMAP specific features in some common way.
Quoted 4 lines
Regards,
Tony
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerRe: [PATCH 4/9] omap: improve OMAP3_HAS_FEATURE
Quoted 26 lines · Nishanth Menon
Quoted 20 lines
Quoted 5 lines
overall, we will face this in the future. there are OMAP generic features and OMAP family specific features. currently OMAP3 has 34xx, 35xx series and 3630 and 37xx series. in future we may see similar things for OMAP4+ as well.. we need a differentiator when it comes to omap3 specific features Vs omap generic feature.
Sounds it will get more complex.. We should probably set it up with something like this then:
#define
FEAT_MPU_L2_OUTERBIT(1)
#defineFEAT_MPU_L2BIT(0)
...#define
FEAT_IVA2BIT(1)
#defineFEAT_IVABIT(0)
...#define
FEAT_L3_192BIT(0)
...Quoted 6 lines
struct omap_feature { u32 mpu; /* MPU features */ u32 iva; /* IVA features */ u32 l3_max_clk; ... };
Quoted 4 lines
I think I understand your intent here is to introduce per IP based feature - that is really not necessary yet (we dont really have a usecase needing this level of complexity yet). it will be a natural evolution when we need to have such a feature handling.
But we already have a problem where we need to check for various revisions and features and use cpu_is_omapxxxx. It would be nice to just call omap_has_feature without having to worry about which omap it is.
Quoted 3 lines
currently a need for errata handling per ip is required, and we have a mechanism (quirks) to handle it on a IP basis. here the intent was to identify OMAP specific features in some common way.
OK. I'll post an experimental series shortly, let's see if that works for you.
Regards,
Tony