Add support for ADC on am437x-gp and am43x-epos-evm
Subsystems (5)
v2 cover Add support for ADC on am437x-gp and am43x-epos-evm
This series of patches enable ADC on am437x-gp-evm and am43x-epos-evm. The ADC clock hwmod data of am33xx has been moved to commom place so that both am43xx and am33xx can reuse them.
tscadc DT node has been adided to am437x-gp and am43x-epos dt files. With these patches, ADC functionalities are now available on am43xx.
Changelog:
v2:
Removed phy addresses in hwmod. Using DT instead.
Removed unused "ti,am4372" compatible string.
Use macro to set clk domain name.
Fixed subject format of all patches
Vignesh R (3):
ARM: OMAP2+: hwmod: AM335x/AM43x: Move am33xx_l4_hs_hwmod to
ipblock_data
ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on
am43x-evm
ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and
am43x-epos-evmarch/arm/boot/dts/am4372.dtsi | 20 ++++++ arch/arm/boot/dts/am437x-gp-evm.dts | 8 +++ arch/arm/boot/dts/am43x-epos-evm.dts | 8 +++ .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h | 2 + .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 71 ++++++++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 64 ------------------- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 1 + 7 files changed, 110 insertions(+), 64 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/3 ARM: OMAP2+: hwmod: AM335x/AM43x: Move am33xx_l4_hs_hwmod to ipblock_data
This patch moves am33xx_l4_hs_hwmod from 33xx_data to ipblock_data. This is required because it can be reused in 43xx to add hwmod support to tscadc as it uses the same l4_hs hwmod in am43xx. This helps in setting appropriate clock domain names for tscadc on am33xx and am43xx.
--- arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h | 1 + arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 15 +++++++++++++++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 15 --------------- 3 files changed, 16 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1 -0
@@ -82,6 +82,7 @@ extern struct omap_hwmod am33xx_l3_main_hwmod;extern struct omap_hwmod am33xx_l3_s_hwmod;extern struct omap_hwmod am33xx_l3_instr_hwmod;extern struct omap_hwmod am33xx_l4_ls_hwmod; +extern struct omap_hwmod am33xx_l4_hs_hwmod;extern struct omap_hwmod am33xx_l4_wkup_hwmod;extern struct omap_hwmod am33xx_mpu_hwmod;extern struct omap_hwmod am33xx_pruss_hwmod;
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +15 -0
@@ -94,6 +94,21 @@ struct omap_hwmod am33xx_l4_ls_hwmod = { }, }; +/* l4_hs */ +struct omap_hwmod am33xx_l4_hs_hwmod = { + .name ="l4_hs" , + .class = &am33xx_l4_hwmod_class, + .clkdm_name ="l4hs_clkdm" , + .flags =HWMOD_INIT_NO_IDLE , + .main_clk ="l4hs_gclk" , + .prcm = { + .omap4 = { + .clkctrl_offs =AM33XX_CM_PER_L4HS_CLKCTRL_OFFSET , + .modulemode =MODULEMODE_SWCTRL , + }, + }, +}; +/* l4_wkup */ struct omap_hwmod am33xx_l4_wkup_hwmod = { .name ="l4_wkup" ,
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +0 -15
@@ -63,21 +63,6 @@ static struct omap_hwmod am33xx_emif_hwmod = { }, }; -/* l4_hs */ -static struct omap_hwmod am33xx_l4_hs_hwmod = { - .name ="l4_hs" , - .class = &am33xx_l4_hwmod_class, - .clkdm_name ="l4hs_clkdm" , - .flags =HWMOD_INIT_NO_IDLE , - .main_clk ="l4hs_gclk" , - .prcm = { - .omap4 = { - .clkctrl_offs =AM33XX_CM_PER_L4HS_CLKCTRL_OFFSET , - .modulemode =MODULEMODE_SWCTRL , - }, - }, -}; -static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = { { .name ="wkup_m3" , .rst_shift =3 , .st_shift =5 }, };
Signature · 1 line
1.9.1
PATCH v2 2/3 ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on am43x-evm
In reply to Vignesh RThis patch adds hwmod support for tscadc to work on am43xx-evm. The am33xx hwmod structures of tscadc has been moved to ipblock_data so that it can be reused in am43xx. The clock domain names are separately set for am33xx and am43xx. Thus tscadc dt entries can now be added to am43xx board dt files.
--- .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h | 1 + .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 56 ++++++++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 49 ------------------- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 1 + 4 files changed, 58 insertions(+), 49 deletions(-)
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1 -0
@@ -65,6 +65,7 @@ extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer4;extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer5;extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer6;extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer7; +extern struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc;extern struct omap_hwmod_ocp_if am33xx_l3_main__tpcc;extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc0;extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc1;
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +56 -0
96 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +0 -49
61 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_43xx_data.c +1 -0
@@ -809,6 +809,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = { &am33xx_l4_ls__timer5, &am33xx_l4_ls__timer6, &am33xx_l4_ls__timer7, + &am33xx_l4_wkup__adc_tsc, &am33xx_l3_main__tpcc, &am33xx_l4_ls__uart2, &am33xx_l4_ls__uart3,
Signature · 1 line
1.9.1
PATCH v2 3/3 ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm
In reply to Vignesh RThis patch adds tscadc DT entries for am437x-gp-evm and am43x-epos-evm.
--- arch/arm/boot/dts/am4372.dtsi | 20 ++++++++++++++++++++ arch/arm/boot/dts/am437x-gp-evm.dts | 8 ++++++++ arch/arm/boot/dts/am43x-epos-evm.dts | 8 ++++++++ 3 files changed, 36 insertions(+)
arch/arm/boot/dts/am4372.dtsi +20 -0
@@ -667,6 +667,26 @@ }; }; + tscadc: tscadc at 44e0d000 { + compatible = "ti,am3359-tscadc"; + reg = <0x44e0d000 0x1000>; + ti,hwmods = "adc_tsc"; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&adc_tsc_fck>; + clock-names = "fck"; + status = "disabled"; + + tsc { + compatible = "ti,am3359-tsc"; + }; + + adc { + #io-channel-cells = <1>; + compatible = "ti,am3359-adc"; + }; + + }; + sham: sham at 53100000 { compatible = "ti,omap5-sham"; ti,hwmods = "sham";
arch/arm/boot/dts/am437x-gp-evm.dts +8 -0
@@ -343,6 +343,14 @@ status = "okay"; }; +&tscadc { + status = "okay"; + + adc { + ti,adc-channels = <0 1 2 3 4 5 6 7>; + }; +}; + &ecap0 { status = "okay"; pinctrl-names = "default";
arch/arm/boot/dts/am43x-epos-evm.dts +8 -0
@@ -519,6 +519,14 @@ status = "okay"; }; +&tscadc { + status = "okay"; + + adc { + ti,adc-channels = <0 1 2 3 4 5 6 7>; + }; +}; + &ecap0 { status = "okay"; pinctrl-names = "default";
Signature · 1 line
1.9.1
Quoted 6 lines · Vignesh R
This series of patches enable ADC on am437x-gp-evm and am43x-epos-evm. The ADC clock hwmod data of am33xx has been moved to commom place so that both am43xx and am33xx can reuse them.
tscadc DT node has been adided to am437x-gp and am43x-epos dt files. With these patches, ADC functionalities are now available on am43xx.
Quoted 8 lines
Changelog:
v2:
Removed phy addresses in hwmod. Using DT instead.
Removed unused "ti,am4372" compatible string.
Use macro to set clk domain name.
Fixed subject format of all patches
Please accept these patches.
Regards
Vignesh R
Quoted 17 lines
Vignesh R (3):
ARM: OMAP2+: hwmod: AM335x/AM43x: Moveam33xx_l4_hs_hwmodto
ipblock_data
ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc onam43x-evm ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evmarch/arm/boot/dts/am4372.dtsi | 20 ++++++ arch/arm/boot/dts/am437x-gp-evm.dts | 8 +++ arch/arm/boot/dts/am43x-epos-evm.dts | 8 +++ .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h | 2 + .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 71 ++++++++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 64 ------------------- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 1 + 7 files changed, 110 insertions(+), 64 deletions(-)
Tony Lindgren
maintainerQuoted 10 lines · Vignesh R
Quoted 8 lines · Vignesh R
This series of patches enable ADC on am437x-gp-evm and am43x-epos-evm. The ADC clock hwmod data of am33xx has been moved to commom place so that both am43xx and am33xx can reuse them.
tscadc DT node has been adided to am437x-gp and am43x-epos dt files. With these patches, ADC functionalities are now available on am43xx.Changelog:
Quoted 8 lines
Quoted 6 lines
v2:
Removed phy addresses in hwmod. Using DT instead.
Removed unused "ti,am4372" compatible string.
Use macro to set clk domain name.
Fixed subject format of all patchesPlease accept these patches.
Adding Paul to Cc, I don't think Paul has seen these, probably because get_maintainer.pl did not catch these hwmod files?
Regards,
Tony
Quoted 17 lines
Quoted 17 lines
Vignesh R (3):
ARM: OMAP2+: hwmod: AM335x/AM43x: Moveam33xx_l4_hs_hwmodto
ipblock_data
ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc onam43x-evm ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evmarch/arm/boot/dts/am4372.dtsi | 20 ++++++ arch/arm/boot/dts/am437x-gp-evm.dts | 8 +++ arch/arm/boot/dts/am43x-epos-evm.dts | 8 +++ .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h | 2 + .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 71 ++++++++++++++++++++++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 64 ------------------- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 1 + 7 files changed, 110 insertions(+), 64 deletions(-)
Paul Walmsley
maintainerRe: [PATCH v2 2/3] ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on am43x-evm
In reply to Vignesh RQuoted 7 lines · Vignesh R
This patch adds hwmod support for tscadc to work on am43xx-evm. The am33xx hwmod structures of tscadc has been moved to
ipblock_dataso that it can be reused in am43xx. The clock domain names are separately set for am33xx and am43xx. Thus tscadc dt entries can now be added to am43xx board dt files.Signed-off-by Vignesh R <[email protected]>
...
Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +0
-0
...
Quoted 12 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +12
-0+static void am33xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l4hs_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l4_wkup_clkdm" ); +} + +static void am43xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l3_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l3s_tsc_clkdm" ); +} +
...
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
Quoted 1 line
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1
-0+am33xx_hwmod_clockdomain ();
I looked at this patch and the one before it. Is there some reason why we need to share these two hwmods between AM33xx and AM43xx? It seems cleaner just to add the ADC data directly to the AM43xx hwmod data file, not touch the AM33xx data, and not add another runtime data update for the clockdomains. Unless there's something that I'm missing?
- Paul
Paul Walmsley
maintainerQuoted 18 lines · Tony Lindgren
Quoted 17 lines · Vignesh R
Quoted 14 lines · Vignesh R
This series of patches enable ADC on am437x-gp-evm and am43x-epos-evm. The ADC clock hwmod data of am33xx has been moved to commom place so that both am43xx and am33xx can reuse them.
tscadc DT node has been adided to am437x-gp and am43x-epos dt files. With these patches, ADC functionalities are now available on am43xx.Changelog:
v2:
Removed phy addresses in hwmod. Using DT instead.
Removed unused "ti,am4372" compatible string.
Use macro to set clk domain name.
Fixed subject format of all patches
Quoted 4 lines
Quoted 1 line
Please accept these patches.
Adding Paul to Cc, I don't think Paul has seen these, probably because get_maintainer.pl did not catch these hwmod files?
Yeah we didn't have top-level coverage for the data files and my attempts to find other in-depth reviewers has so far failed. So just sent this:
http://marc.info/?l=linux-omap&m=141650684712440&w=2
Want to take it upstream?
- Paul
Re: [PATCH v2 2/3] ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on am43x-evm
In reply to Paul WalmsleyQuoted 31 lines · Paul Walmsley
Quoted 7 lines · Vignesh R
This patch adds hwmod support for tscadc to work on am43xx-evm. The am33xx hwmod structures of tscadc has been moved to
ipblock_dataso that it can be reused in am43xx. The clock domain names are separately set for am33xx and am43xx. Thus tscadc dt entries can now be added to am43xx board dt files.Signed-off-by Vignesh R <[email protected]>...
Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +0
-0...
Quoted 12 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +12
-0+static void am33xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l4hs_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l4_wkup_clkdm" ); +} + +static void am43xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l3_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l3s_tsc_clkdm" ); +} +...
Quoted 6 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
Quoted 1 line
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1
-0+am33xx_hwmod_clockdomain ();I looked at this patch and the one before it. Is there some reason why we need to share these two hwmods between AM33xx and AM43xx? It seems cleaner just to add the ADC data directly to the AM43xx hwmod data file, not touch the AM33xx data, and not add another runtime data update for the clockdomains. Unless there's something that I'm missing?
I wanted to reuse hwmod structures. Except for clockdomain and offset, rest of the hwmod data are same for AM33xx and AM43xx. Adding data to AM43xx hwmod file just duplicates these structures. Do you still want me to move them to AM43xx file?
Regards
Vignesh
Quoted 1 line
- Paul
Paul Walmsley
maintainerRe: [PATCH v2 2/3] ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on am43x-evm
Quoted 40 lines · Vignesh R
Quoted 31 lines · Paul Walmsley
Quoted 7 lines · Vignesh R
This patch adds hwmod support for tscadc to work on am43xx-evm. The am33xx hwmod structures of tscadc has been moved to
ipblock_dataso that it can be reused in am43xx. The clock domain names are separately set for am33xx and am43xx. Thus tscadc dt entries can now be added to am43xx board dt files.Signed-off-by Vignesh R <[email protected]>...
Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +0
-0...
Quoted 12 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +12
-0+static void am33xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l4hs_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l4_wkup_clkdm" ); +} + +static void am43xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l3_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l3s_tsc_clkdm" ); +} +...
Quoted 6 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
Quoted 1 line
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1
-0+am33xx_hwmod_clockdomain ();I looked at this patch and the one before it. Is there some reason why we need to share these two hwmods between AM33xx and AM43xx? It seems cleaner just to add the ADC data directly to the AM43xx hwmod data file, not touch the AM33xx data, and not add another runtime data update for the clockdomains. Unless there's something that I'm missing?
Quoted 4 lines
I wanted to reuse hwmod structures. Except for clockdomain and offset, rest of the hwmod data are same for AM33xx and AM43xx. Adding data to AM43xx hwmod file just duplicates these structures. Do you still want me to move them to AM43xx file?
Yes. It looks to me like the number of lines saved by eliminating the duplication is not too different than the number of lines added with the dynamic clockdomain rewriting. Plus then we can avoid the dynamic clockdomain rewriting that we are only doing for two IP blocks. Ideally the hwmod data is meant to be static, not changed at runtime. For the moment we are stuck with the CLKCTRL rewriting but I personally consider that to be a hack.
- Paul
Re: [PATCH v2 2/3] ARM: OMAP2+: hwmod: AM335x/AM43x: add hwmod support for tscadc on am43x-evm
Quoted 47 lines · Paul Walmsley
Quoted 40 lines · Vignesh R
Quoted 31 lines · Paul Walmsley
Quoted 7 lines · Vignesh R
This patch adds hwmod support for tscadc to work on am43xx-evm. The am33xx hwmod structures of tscadc has been moved to
ipblock_dataso that it can be reused in am43xx. The clock domain names are separately set for am33xx and am43xx. Thus tscadc dt entries can now be added to am43xx board dt files.Signed-off-by Vignesh R <[email protected]>...
Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +0
-0...
Quoted 12 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +12
-0+static void am33xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l4hs_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l4_wkup_clkdm" ); +} + +static void am43xx_hwmod_clockdomain (void ) +{ +CLKDMNAME (am33xx_l4_hs_hwmod,"l3_clkdm" ); +CLKDMNAME (am33xx_adc_tsc_hwmod,"l3s_tsc_clkdm" ); +} +...
Quoted 6 lines
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
Quoted 1 line
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +1
-0+am33xx_hwmod_clockdomain ();I looked at this patch and the one before it. Is there some reason why we need to share these two hwmods between AM33xx and AM43xx? It seems cleaner just to add the ADC data directly to the AM43xx hwmod data file, not touch the AM33xx data, and not add another runtime data update for the clockdomains. Unless there's something that I'm missing?
Quoted 4 lines
I wanted to reuse hwmod structures. Except for clockdomain and offset, rest of the hwmod data are same for AM33xx and AM43xx. Adding data to AM43xx hwmod file just duplicates these structures. Do you still want me to move them to AM43xx file?
Quoted 8 lines
Yes. It looks to me like the number of lines saved by eliminating the duplication is not too different than the number of lines added with the dynamic clockdomain rewriting. Plus then we can avoid the dynamic clockdomain rewriting that we are only doing for two IP blocks. Ideally the hwmod data is meant to be static, not changed at runtime. For the moment we are stuck with the CLKCTRL rewriting but I personally consider that to be a hack.
Ok, will add ADC data to AM43xx and post v3.
Regards
Vignesh
Quoted 3 lines
- Paul