introduce generic OMAP SOC features
Subsystems (4)
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.
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 does not attempt to define what the features for OMAP1,2,3,4 would be. 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 (6):
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
arch/arm/mach-omap1/id.c | 2 +- arch/arm/mach-omap1/io.c | 1 - arch/arm/mach-omap2/id.c | 36 +++++++--------- arch/arm/mach-omap2/io.c | 2 +- arch/arm/plat-omap/common.c | 14 ++++++ arch/arm/plat-omap/include/plat/cpu.h | 72 ++++++++++++++++++++++----------- 6 files changed, 80 insertions(+), 47 deletions(-)
scripts/bloat-o-meter vmlinux.master vmlinux add/remove: 2/5 grow/shrink: 8/9 up/down: 1500/-1504 (-4)
function old new delta omap2_check_revision 168 1528 +1360 omap_check_revision - 60 +60 ubifs_scan 632 676 +44 rd_load_image 1340 1352 +12 test_hash 1088 1092 +4 omap_features - 4 +4 in4_pton 360 364 +4 ieee80211_assoc_done 1840 1844 +4 elf_core_dump 3632 3636 +4 __posix_lock_file 1264 1268 +4 ubifs_tnc_end_commit 1468 1464 -4 nfs3_listxattr 272 268 -4 jffs2_build_xattr_subsystem 1428 1424 -4 generic_file_aio_read 1692 1688 -4 do_task_stat 1424 1420 -4 onenand_read_ops_nolock 1016 1008 -8 musb_host_rx 2672 2660 -12 arch_get_unmapped_area 528 512 -16 scsi_io_completion 1204 1184 -20 omap4_check_revision 128 - -128 omap3_check_features 172 - -172 omap24xx_check_revision 252 - -252 omap3_check_revision 316 - -316 omap3_cpuinfo 560 - -560
Regards,
Nishanth Menon
PATCH 1/6 omap1: rename check_revision
Rename 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
@@ -21,7 +21,7 @@#include "clock.h" -extern void omap_check_revision (void ); +extern void omap1_check_revision (void );extern void omap_sram_init (void );/*
@@ -103,7 +103,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 2/6 omap2/3: id: fix sparse warning
omap24xx_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 3/6 omap: generic: introduce a single check_revision
Introduce 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 | 11 +++++++++++ arch/arm/plat-omap/include/plat/cpu.h | 13 ++++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-)
arch/arm/mach-omap1/io.c +1 -2
@@ -21,7 +21,6 @@#include "clock.h" -extern void omap1_check_revision (void );extern void omap_sram_init (void );/*
@@ -103,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. */ -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
@@ -239,7 +239,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 ();omap_vram_reserve_sdram (); }
arch/arm/plat-omap/common.c +11 -0
@@ -81,6 +81,17 @@ const void *omap_get_var_config(u16 tag, size_t *len) }EXPORT_SYMBOL (omap_get_var_config); +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 4/6 omap: improve OMAP3_HAS_FEATURE
Replace 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 5/6 omap: introduce OMAP_SHOW_FEATURE
change 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 6/6 omap: move generic omap3 features to generic
sgx, 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 | 3 ++ arch/arm/plat-omap/include/plat/cpu.h | 39 +++++++++++++++++++------------- 3 files changed, 36 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 +3 -0
@@ -81,6 +81,9 @@ const void *omap_get_var_config(u16 tag, size_t *len) }EXPORT_SYMBOL (omap_get_var_config); +/* OMAP Generic features */ +u32 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 6/6] omap: move generic omap3 features to generic
Quoted 32 lines · Nishanth Menon
sgx, 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
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-omap2/id.c | 20 ++++++++--------arch/arm/plat-omap/common.c| 3 ++arch/arm/plat-omap/include/plat/cpu.h| 39 +++++++++++++++++++-------------3 files changed, 36 insertions(+), 26 deletions(-)arch/arm/mach-omap2/id.c +0
-0
arch/arm/mach-omap2/id.c static void __init omap24xx_check_revision(void) · line 165
Quoted 6 lines
arch/arm/mach-omap2/id.c +1
-1@@ -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; \ }
"CHECK" sounds like a querying API, whereas the macro populates data. Maybe UPDATE or SET ?
Quoted 113 lines
arch/arm/mach-omap2/id.c +9
-9static 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 +3
-0@@ -81,6 +81,9 @@ const void *omap_get_var_config(u16 tag, size_t *len) } EXPORT_SYMBOL(omap_get_var_config); +/* OMAP Generic features */ +u32 omap_features; + void __init omap_check_revision() { #ifdef CONFIG_ARCH_OMAP1arch/arm/plat-omap/include/plat/cpu.h +23
-11@@ -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)
arch/arm/plat-omap/include/plat/cpu.h static inline unsigned int omap##rev##_has_ ##feat(void) \
Quoted 10 lines
arch/arm/plat-omap/include/plat/cpu.h +0
-6-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 --
What about feature detection for OMAP2 and OMAP4 (similar to omap3_check_features) ?
At least a dummy implementation with warning messages would be good, so that they are not used without initialization.
Regards,
Venkat.
--
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 6/6] omap: move generic omap3 features to generic
Quoted 1 line · Venkatraman
Nishanth Menon<[email protected]> wrote:
[..]
Quoted 6 lines
Quoted 6 lines
arch/arm/mach-omap2/id.c +0
-0@@ -161,7 +161,7 @@ static void __init omap24xx_check_revision(void)#define OMAP3_CHECK_FEATURE (status,feat) \
Quoted 9 lines
arch/arm/mach-omap2/id.c static void __init omap24xx_check_revision(void) · line 165
Quoted 5 lines
arch/arm/mach-omap2/id.c +1
-1if (((status& OMAP3_ ##feat## _MASK) \ >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \ - omap3_features |= OMAP3_HAS_ ##feat; \ + omap_features |= OMAP_HAS_ ##feat; \ }"CHECK" sounds like a querying API, whereas the macro populates data. Maybe UPDATE or SET ?
Depends on where you are looking at it from: overall it is checking the status bits from OMAP and deciding what features it has - this is specifically important for 35xx series of processors. it is indeed a check in that sense. if you look at it from features variable, yeah it is updating it, but the idea of usage of the Macro is: check in status if feature X is available.. which is what it does ;). btw, the intent of the current patch was not meant to rename CHECK_FEATURE as it was very OMAP3 specific ;)
Quoted 3 lines
Quoted 3 lines
arch/arm/mach-omap2/id.c +0
-0static void __init omap3_check_features (void )@@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void)/*
[...]
Quoted 25 lines
Quoted 25 lines
arch/arm/mach-omap2/id.c +7
-10+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)
Quoted 7 lines
Quoted 2 lines
#endif
--What about feature detection for OMAP2 and OMAP4 (similar to
omap3_check_features) ?
At least a dummy implementation with warning messages would be good, so that they are not used without initialization.
there is no need for warning messages, they will return as feature not present. cpu.h is a common header and variable omap_features is in common.c, the check_feature and id.c has not set that bit, the variable will remain 0, hence omap_has_sgx() will return 0 unless someone enables that for lets say OMAP4 -> feel free to do it, as I mentioned in 0/6, this series was meant solely to reorganize and provide an infrastructure for further development.
Regards,
Nishanth Menon
Re: [PATCH 6/6] omap: move generic omap3 features to generic
Quoted 21 lines · Nishanth Menon
Quoted 2 lines · Venkatraman
Nishanth Menon<[email protected]> wrote:
[..]
Quoted 16 lines
arch/arm/mach-omap2/id.c static void __init omap24xx_check_revision(void) · line 165
Quoted 12 lines
arch/arm/mach-omap2/id.c +1
-1@@ -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; \ }"CHECK" sounds like a querying API, whereas the macro populates data. Maybe UPDATE or SET ?
Quoted 8 lines
Depends on where you are looking at it from: overall it is checking the status bits from OMAP and deciding what features it has - this is specifically important for 35xx series of processors. it is indeed a check in that sense. if you look at it from features variable, yeah it is updating it, but the idea of usage of the Macro is: check in status if feature X is available.. which is what it does ;). btw, the intent of the current patch was not meant to rename
CHECK_FEATUREas it was very OMAP3 specific ;)
It's ok. I don't want to worry too much about the name.
Quoted 39 lines
Quoted 3 lines
Quoted 3 lines
arch/arm/mach-omap2/id.c +0
-0static void __init omap3_check_features(void)@@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void) /*[...]
Quoted 25 lines
Quoted 25 lines
arch/arm/mach-omap2/id.c +7
-0+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 u32omap3_features;arch/arm/mach-omap2/id.c +0
-5-#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_CLKBIT(5)arch/arm/mach-omap2/id.c +0
-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)
Quoted 7 lines
Quoted 2 lines
#endif
--What about feature detection for OMAP2 and OMAP4 (similar to
omap3_check_features) ?
At least a dummy implementation with warning messages would be good, so that they are not used without initialization.
Quoted 7 lines
there is no need for warning messages, they will return as feature not present.
cpu.his a common header and variableomap_featuresis incommon.c, thecheck_featureandid.chas not set that bit, the variable will remain 0, henceomap_has_sgx()will return 0 unless someone enables that for lets say OMAP4 -> feel free to do it, as I mentioned in 0/6, this series was meant solely to reorganize and provide an infrastructure for further development.
I don't agree. The patch / series is about making them 'generic', where generic is, to the minimum, "making the features exposed for major silicon versions". If they are not usable beyond OMAP3, it's not generic.
[Apologies for the delayed reply, seem to have a delayed delivery issue] -Venkat.
--
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 6/6] omap: move generic omap3 features to generic
Quoted 31 lines · Venkatraman S
Quoted 21 lines · Nishanth Menon
Quoted 2 lines · Venkatraman
Nishanth Menon<[email protected]> wrote:
[..]
Quoted 16 lines
arch/arm/mach-omap2/id.c static void __init omap24xx_check_revision(void) · line 165
Quoted 12 lines
arch/arm/mach-omap2/id.c +1
-1@@ -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; \ }"CHECK" sounds like a querying API, whereas the macro populates data. Maybe UPDATE or SET ?
Quoted 8 lines
Depends on where you are looking at it from: overall it is checking the status bits from OMAP and deciding what features it has - this is specifically important for 35xx series of processors. it is indeed a check in that sense. if you look at it from features variable, yeah it is updating it, but the idea of usage of the Macro is: check in status if feature X is available.. which is what it does ;). btw, the intent of the current patch was not meant to rename
CHECK_FEATUREas it was very OMAP3 specific ;)
Quoted 1 line
It's ok. I don't want to worry too much about the name.
Thanks.
Quoted 48 lines
Quoted 40 lines
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-omap2/id.c +0
-0static void __init omap3_check_features (void )@@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void)/* [...]
Quoted 25 lines
Quoted 25 lines
arch/arm/mach-omap2/id.c +7
-10+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)Quoted 7 lines
Quoted 2 lines
#endif
--What about feature detection for OMAP2 and OMAP4 (similar to
omap3_check_features) ?
At least a dummy implementation with warning messages would be good, so that they are not used without initialization.Quoted 7 lines
there is no need for warning messages, they will return as feature not present.
cpu.his a common header and variableomap_featuresis incommon.c, thecheck_featureandid.chas not set that bit, the variable will remain 0, henceomap_has_sgx()will return 0 unless someone enables that for lets say OMAP4 -> feel free to do it, as I mentioned in 0/6, this series was meant solely to reorganize and provide an infrastructure for further development.
Quoted 4 lines
I don't agree. The patch / series is about making them 'generic', where generic is, to the minimum, "making the features exposed for major silicon versions". If they are not usable beyond OMAP3, it's not generic.
Which part is not generic? I am unable to comprehend your contention here. Are you contending that ISP, l2cache, neon, isp are *not* generic OMAP features? or are you contending that since I did not add the OMAP2,4 logic to detect the same, this patch is not valid?
all silicon revisions CAN use the function omap_has_sgx() now, even though I have not added detection logic to actually populate the same. if you do have a patch for detecting actual OMAP4/2 features feel free to add to the patch list, I am more than happy to ack them, if they look good - I personally dont have a omap4 platform at the very moment to write and post a patch - however trivial it may be.
Regards,
Nishanth Menon
Re: [PATCH 6/6] omap: move generic omap3 features to generic
Quoted 105 lines · Nishanth Menon
Quoted 42 lines · Venkatraman S
Quoted 27 lines · Nishanth Menon
Quoted 2 lines · Venkatraman
Nishanth Menon<[email protected]> wrote:
[..]
Quoted 12 lines
Quoted 12 lines
arch/arm/mach-omap2/id.c +0
-0@@ -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) { \Quoted 9 lines
Quoted 5 lines
arch/arm/mach-omap2/id.c +0
-1- omap3_features |= OMAP3_HAS_ ##feat;\
+omap_features|=OMAP_HAS_##feat; \
}"CHECK" sounds like a querying API, whereas the macro populates data. Maybe UPDATE or SET ?
Quoted 12 lines
Depends on where you are looking at it from: overall it is checking the status bits from OMAP and deciding what features it has - this is specifically important for 35xx series of processors. it is indeed a check
in that sense. if you look at it from features variable, yeah it is updating
it, but the idea of usage of the Macro is: check in status if feature X is
available.. which is what it does ;). btw, the intent of the current patch
was not meant to renameCHECK_FEATUREas it was very OMAP3 specific ;)Quoted 1 line
It's ok. I don't want to worry too much about the name.
Thanks.
Quoted 53 lines
Quoted 40 lines
Quoted 4 lines
Quoted 4 lines
static void
__initomap3_check_features(void)arch/arm/mach-omap2/id.c +0
-0@@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void) /*[...]
Quoted 25 lines
Quoted 25 lines
arch/arm/mach-omap2/id.c +7
-0+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 u32omap3_features;arch/arm/mach-omap2/id.c +0
-5-#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_CLKBIT(5)arch/arm/mach-omap2/id.c +0
-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)
Quoted 7 lines
Quoted 2 lines
#endif
--What about feature detection for OMAP2 and OMAP4 (similar to
omap3_check_features) ?
At least a dummy implementation with warning messages would be good, so that they are not used without initialization.Quoted 12 lines
there is no need for warning messages, they will return as feature not present.
cpu.his a common header and variableomap_featuresis incommon.c,
thecheck_featureandid.chas not set that bit, the variable will remain 0,
henceomap_has_sgx()will return 0 unless someone enables that for lets say
OMAP4 -> feel free to do it, as I mentioned in 0/6, this series was meant
solely to reorganize and provide an infrastructure for further development.Quoted 6 lines
I don't agree. The patch / series is about making them 'generic', where generic
is, to the minimum, "making the features exposed for major silicon versions".
If they are not usable beyond OMAP3, it's not generic.
Quoted 11 lines
Which part is not generic? I am unable to comprehend your contention here. Are you contending that ISP, l2cache, neon, isp are *not* generic OMAP features? or are you contending that since I did not add the OMAP2,4 logic to detect the same, this patch is not valid?
all silicon revisions CAN use the functionomap_has_sgx()now, even though I have not added detection logic to actually populate the same. if you do have a patch for detecting actual OMAP4/2 features feel free to add to the patch list, I am more than happy to ack them, if they look good - I personally dont have a omap4 platform at the very moment to write and post a patch - however trivial it may be.
It is this..
Quoted 2 lines
or are you contending that since I did not add the OMAP2,4 logic to detect the same, this patch is not valid?
I understand that you might not have all platforms to test with, but let's not provide a
'generic feature api' without it being available for the supported platforms. It's incomplete without it.
Regards,
Venkat.
--
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 6/6] omap: move generic omap3 features to generic
Quoted 4 lines · Venkatraman
I understand that you might not have all platforms to test with, but let's not provide a
'generic feature api' without it being available for the supported platforms. It's incomplete without it.
well.. if you did read 0/6
http://marc.info/?l=linux-omap&m=127458581708411&w=2
"Caveat: this series just introduces the framework by reorganizing
the existing data, it does not attempt to define what the features
for OMAP1,2,3,4 would be. As usual, comments are welcome.
"
:) anyways, these are how the three follow on patches will look like (sample omap1,2,4 patches are attached), feel free to ack them after testing - but this patch 6/6 needs to be done prior to the remaining being added - that is one more reason why i stopped where I did.
Feel free to modify to rectify my patches and post good ones, as you see, you will need to do 6/6 before doing anything further anyways..
Regards,
Nishanth Menon
Quoted 1 line
From
a4f7d23139f8ccfc6b0e910017a759faa0d59578Mon Sep 17 00:00:00 2001
From: Nishanth Menon <[email protected]>
Date: Mon, 31 May 2010 14:03:28 -0500
Subject: [PATCH 1/3] omap: id: introduce omap4 feature
introduce basic omap4 feature framework
---
CAVEAT: COMPLETELY UNTESTED!!!
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
Quoted 1 line
From
0e4c9df9870c29da19234a1f4be5227a289b6463Mon Sep 17 00:00:00 2001
From: Nishanth Menon <[email protected]>
Date: Mon, 31 May 2010 14:10:31 -0500
Subject: [PATCH 2/3] omap: id: introduce omap24xx generic features
introduce generic features for omap2. omap2 uses mbx, not sgx, and it still has a dsp, though not iva2 as omap3 uses..
---
CAVEAT: COMPLETELY UNTESTED!!!
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
Quoted 1 line
From
c297e29bfd27c373af8d9bdc428f72cad2ef4e7aMon Sep 17 00:00:00 2001
From: Nishanth Menon <[email protected]>
Date: Mon, 31 May 2010 14:13:57 -0500
Subject: [PATCH 3/3] omap: id: add feature check for omap1
add a minimalist feature - l2cache for omap1.
---
CAVEAT: COMPLETELY UNTESTED!!!
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
Re: [PATCH 6/6] omap: move generic omap3 features to generic
Quoted 8 lines · Nishanth Menon
Quoted 6 lines · Venkatraman
I understand that you might not have all platforms to test with, but let's not provide a
'generic feature api' without it being available for the supported platforms.
It's incomplete without it.
Quoted 6 lines
well.. if you did read 0/6
http://marc.info/?l=linux-omap&m=127458581708411&w=2
"Caveat: this series just introduces the framework by reorganizing the existing data, it does not attempt to define what the features for OMAP1,2,3,4 would be. As usual, comments are welcome. "
I did see this. My point was the 6/6 claims to do $foo (where $foo= make it generic)
doesn't fit with a caveat description (My patch doesn't do $foo)
Quoted 4 lines
:) anyways, these are how the three follow on patches will look like (sample omap1,2,4 patches are attached), feel free to ack them after testing - but this patch 6/6 needs to be done prior to the remaining being added - that is one more reason why i stopped where I did.
If you can post them formally as part of the series, I can test and ack them (with OMAP3, OMAP4)
My original comment was even if these were not implemented due to some constraints, they should be
mentioned in the code (as TODO / FIXME etc). The caveat description is not going to show up in
commit logs or printks
Re: [PATCH 6/6] omap: move generic omap3 features to generic
Quoted 7 lines · Venkatraman S
If you can post them formally as part of the series, I can test and ack them (with OMAP3, OMAP4)
My original comment was even if these were not implemented due to some constraints, they should be
mentioned in the code (as TODO / FIXME etc). The caveat description is not going to show up in
commit logs or printks
okie.. the 3 RFC patches following to the list.
Regards,
Nishanth Menon