soc/tegra: pmc: Use lower-case for hexadecimal literals
PATCH 1/3 soc/tegra: pmc: Use lower-case for hexadecimal literals
From: Thierry Reding <[email protected]>
The remainder of the file uses lower-case for hexadecimal literals, so change the only odd-one-out occurrence for consistency.
--- drivers/soc/tegra/pmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/pmc.c +1 -1
@@ -2805,7 +2805,7 @@ static const struct tegra_pmc_regs tegra186_pmc_regs = { .dpd2_status = 0x80, .rst_status = 0x70, .rst_source_shift = 0x2, - .rst_source_mask = 0x3C, + .rst_source_mask = 0x3c, .rst_level_shift = 0x0, .rst_level_mask = 0x3, };
Signature · 1 line
2.23.0
PATCH 2/3 soc/tegra: pmc: Add missing IRQ callbacks on Tegra194
From: Thierry Reding <[email protected]>
Reuse the IRQ callbacks from Tegra186 on Tegra194. This fixes failures to request interrupts on Tegra194 due to the missing callbacks.
--- drivers/soc/tegra/pmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/tegra/pmc.c +2 -0
@@ -2947,6 +2947,8 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .regs = &tegra186_pmc_regs, .init = NULL, .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, + .irq_set_wake = tegra186_pmc_irq_set_wake, + .irq_set_type = tegra186_pmc_irq_set_type, .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
Signature · 1 line
2.23.0
Re: [PATCH 2/3] soc/tegra: pmc: Add missing IRQ callbacks on Tegra194
Quoted 18 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Reuse the IRQ callbacks from Tegra186 on Tegra194. This fixes failures to request interrupts on Tegra194 due to the missing callbacks.
Cc Sowjanya Komatineni <[email protected]>Fixes aba19827fced ("soc/tegra: pmc: Support wake events on more Tegra SoCs")Signed-off-by Thierry Reding <[email protected]>--- drivers/soc/tegra/pmc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/soc/tegra/pmc.c +0
-0
drivers/soc/tegra/pmc.c static const struct tegra_pmc_soc tegra194_pmc_soc = { · line 2954
Quoted 8 lines
drivers/soc/tegra/pmc.c +2
-0@@ -2947,6 +2947,8 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .regs = &tegra186_pmc_regs, .init = NULL, .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, + .irq_set_wake = tegra186_pmc_irq_set_wake, + .irq_set_type = tegra186_pmc_irq_set_type, .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
Cheers!
Jon
Signature · 1 line
nvpublic
PATCH 3/3 soc/tegra: pmc: Add reset sources and levels on Tegra194
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Tegra194 supports the same reset levels as Tegra186 but extends the set of reset sources. Provide custom PMC register definitions to account for the larger field for the reset sources as well as the updated list of reset sources.
--- drivers/soc/tegra/pmc.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
drivers/soc/tegra/pmc.c +41 -0
@@ -2927,6 +2927,43 @@ static const struct tegra_io_pad_soc tegra194_io_pads[] = { { .id = TEGRA_IO_PAD_AUDIO_HV, .dpd = 61, .voltage = UINT_MAX }, }; +static const struct tegra_pmc_regs tegra194_pmc_regs = { + .scratch0 =0x2000 , + .dpd_req =0x74 , + .dpd_status =0x78 , + .dpd2_req =0x7c , + .dpd2_status =0x80 , + .rst_status =0x70 , + .rst_source_shift =0x2 , + .rst_source_mask =0x7c , + .rst_level_shift =0x0 , + .rst_level_mask =0x3 , +}; + +static const char *const tegra194_reset_sources[] = { +"SYS_RESET_N" , +"AOWDT" , +"BCCPLEXWDT" , +"BPMPWDT" , +"SCEWDT" , +"SPEWDT" , +"APEWDT" , +"LCCPLEXWDT" , +"SENSOR" , +"AOTAG" , +"VFSENSOR" , +"MAINSWRST" , +"SC7" , +"HSM" , +"CSITE" , +"RCEWDT" , +"PVA0WDT" , +"PVA1WDT" , +"L1A_ASYNC" , +"BPMPBOOT" , +"FUSECRC" , +}; +static const struct tegra_wake_event tegra194_wake_events[] = {TEGRA_WAKE_GPIO ("power" ,29 ,1 ,TEGRA194_AON_GPIO (EE ,4 )), TEGRA_WAKE_IRQ("rtc", 73, 10),
@@ -2949,6 +2986,10 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, .irq_set_wake = tegra186_pmc_irq_set_wake, .irq_set_type = tegra186_pmc_irq_set_type, + .reset_sources = tegra194_reset_sources, + .num_reset_sources = ARRAY_SIZE(tegra194_reset_sources), + .reset_levels = tegra186_reset_levels, + .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
Signature · 1 line
2.23.0
Jon Hunter
maintainerRe: [PATCH 3/3] soc/tegra: pmc: Add reset sources and levels on Tegra194
Quoted 23 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra194 supports the same reset levels as Tegra186 but extends the set of reset sources. Provide custom PMC register definitions to account for the larger field for the reset sources as well as the updated list of reset sources.
Signed-off-by Thierry Reding <[email protected]>--- drivers/soc/tegra/pmc.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)drivers/soc/tegra/pmc.c +3
-0@@ -2927,6 +2927,43 @@ static const struct tegra_io_pad_soc tegra194_io_pads[] = { { .id = TEGRA_IO_PAD_AUDIO_HV, .dpd = 61, .voltage = UINT_MAX }, }; +static const struct tegra_pmc_regs tegra194_pmc_regs = { + .scratch0 =0x2000 , + .dpd_req = 0x74,
drivers/soc/tegra/pmc.c static const struct tegra_io_pad_soc tegra194_io_pads[] = { · line 2942
Quoted 10 lines
drivers/soc/tegra/pmc.c +10
-0+ .dpd_status = 0x78, + .dpd2_req = 0x7c, + .dpd2_status = 0x80, + .rst_status = 0x70, + .rst_source_shift = 0x2, + .rst_source_mask = 0x7c, + .rst_level_shift = 0x0, + .rst_level_mask = 0x3, +}; +
You added the regs here, but ...
Quoted 28 lines
drivers/soc/tegra/pmc.c +24
-0+static const char *const tegra194_reset_sources[] = { +"SYS_RESET_N" , +"AOWDT" , +"BCCPLEXWDT" , +"BPMPWDT" , +"SCEWDT" , +"SPEWDT" , +"APEWDT" , +"LCCPLEXWDT" , +"SENSOR" , +"AOTAG" , +"VFSENSOR" , +"MAINSWRST" , +"SC7" , +"HSM" , +"CSITE" , +"RCEWDT" , +"PVA0WDT" , +"PVA1WDT" , +"L1A_ASYNC" , +"BPMPBOOT" , +"FUSECRC" , +}; +static const struct tegra_wake_event tegra194_wake_events[] = {TEGRA_WAKE_GPIO ("power" ,29 ,1 ,TEGRA194_AON_GPIO (EE ,4 )),TEGRA_WAKE_IRQ ("rtc" ,73 ,10 ),
drivers/soc/tegra/pmc.c static const struct tegra_pmc_soc tegra194_pmc_soc = { · line 2995
Quoted 10 lines
drivers/soc/tegra/pmc.c +4
-0@@ -2949,6 +2986,10 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, .irq_set_wake = tegra186_pmc_irq_set_wake, .irq_set_type = tegra186_pmc_irq_set_type, + .reset_sources = tegra194_reset_sources, + .num_reset_sources = ARRAY_SIZE(tegra194_reset_sources), + .reset_levels = tegra186_reset_levels, + .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
.. but does not look like you updated the above to use the new register struct. Looks like it still uses the Tegra186 regs.
Jon
Signature · 1 line
nvpublic
PATCH v2 3/3 soc/tegra: pmc: Add reset sources and levels on Tegra194
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Tegra194 supports the same reset levels as Tegra186 but extends the set of reset sources. Provide custom PMC register definitions to account for the larger field for the reset sources as well as the updated list of reset sources.
---
Changes in v2:
- use the new Tegra194 register definitions
drivers/soc/tegra/pmc.c | 43 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
drivers/soc/tegra/pmc.c +42 -1
@@ -2926,6 +2926,43 @@ static const struct tegra_io_pad_soc tegra194_io_pads[] = { { .id = TEGRA_IO_PAD_AUDIO_HV, .dpd = 61, .voltage = UINT_MAX }, }; +static const struct tegra_pmc_regs tegra194_pmc_regs = { + .scratch0 =0x2000 , + .dpd_req =0x74 , + .dpd_status =0x78 , + .dpd2_req =0x7c , + .dpd2_status =0x80 , + .rst_status =0x70 , + .rst_source_shift =0x2 , + .rst_source_mask =0x7c , + .rst_level_shift =0x0 , + .rst_level_mask =0x3 , +}; + +static const char *const tegra194_reset_sources[] = { +"SYS_RESET_N" , +"AOWDT" , +"BCCPLEXWDT" , +"BPMPWDT" , +"SCEWDT" , +"SPEWDT" , +"APEWDT" , +"LCCPLEXWDT" , +"SENSOR" , +"AOTAG" , +"VFSENSOR" , +"MAINSWRST" , +"SC7" , +"HSM" , +"CSITE" , +"RCEWDT" , +"PVA0WDT" , +"PVA1WDT" , +"L1A_ASYNC" , +"BPMPBOOT" , +"FUSECRC" , +}; +static const struct tegra_wake_event tegra194_wake_events[] = {TEGRA_WAKE_GPIO ("power" ,29 ,1 ,TEGRA194_AON_GPIO (EE ,4 )), TEGRA_WAKE_IRQ("rtc", 73, 10),
@@ -2943,11 +2980,15 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .maybe_tz_only = false, .num_io_pads = ARRAY_SIZE(tegra194_io_pads), .io_pads = tegra194_io_pads, - .regs = &tegra186_pmc_regs, + .regs = &tegra194_pmc_regs, .init = NULL, .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, .irq_set_wake = tegra186_pmc_irq_set_wake, .irq_set_type = tegra186_pmc_irq_set_type, + .reset_sources = tegra194_reset_sources, + .num_reset_sources = ARRAY_SIZE(tegra194_reset_sources), + .reset_levels = tegra186_reset_levels, + .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
Signature · 1 line
2.23.0
Re: [PATCH v2 3/3] soc/tegra: pmc: Add reset sources and levels on Tegra194
Quoted 71 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra194 supports the same reset levels as Tegra186 but extends the set of reset sources. Provide custom PMC register definitions to account for the larger field for the reset sources as well as the updated list of reset sources.
Signed-off-by Thierry Reding <[email protected]>---
Changes in v2:
- use the new Tegra194 register definitionsdrivers/soc/tegra/pmc.c | 43 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)drivers/soc/tegra/pmc.c +38
-1@@ -2926,6 +2926,43 @@ static const struct tegra_io_pad_soc tegra194_io_pads[] = { { .id = TEGRA_IO_PAD_AUDIO_HV, .dpd = 61, .voltage = UINT_MAX }, }; +static const struct tegra_pmc_regs tegra194_pmc_regs = { + .scratch0 =0x2000 , + .dpd_req =0x74 , + .dpd_status =0x78 , + .dpd2_req =0x7c , + .dpd2_status =0x80 , + .rst_status =0x70 , + .rst_source_shift =0x2 , + .rst_source_mask =0x7c , + .rst_level_shift =0x0 , + .rst_level_mask =0x3 , +}; + +static const char *const tegra194_reset_sources[] = { +"SYS_RESET_N" , +"AOWDT" , +"BCCPLEXWDT" , +"BPMPWDT" , +"SCEWDT" , +"SPEWDT" , +"APEWDT" , +"LCCPLEXWDT" , +"SENSOR" , +"AOTAG" , +"VFSENSOR" , +"MAINSWRST" , +"SC7" , +"HSM" , +"CSITE" , +"RCEWDT" , +"PVA0WDT" , +"PVA1WDT" , +"L1A_ASYNC" , +"BPMPBOOT" , +"FUSECRC" , +}; +static const struct tegra_wake_event tegra194_wake_events[] = {TEGRA_WAKE_GPIO ("power" ,29 ,1 ,TEGRA194_AON_GPIO (EE ,4 )), TEGRA_WAKE_IRQ("rtc", 73, 10),@@ -2943,11 +2980,15 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = { .maybe_tz_only = false, .num_io_pads = ARRAY_SIZE(tegra194_io_pads), .io_pads = tegra194_io_pads, - .regs = &tegra186_pmc_regs, + .regs = &tegra194_pmc_regs, .init = NULL,
drivers/soc/tegra/pmc.c static const struct tegra_pmc_soc tegra194_pmc_soc = { · line 2994
Quoted 10 lines
drivers/soc/tegra/pmc.c +4
-0.setup_irq_polarity = tegra186_pmc_setup_irq_polarity, .irq_set_wake = tegra186_pmc_irq_set_wake, .irq_set_type = tegra186_pmc_irq_set_type, + .reset_sources = tegra194_reset_sources, + .num_reset_sources = ARRAY_SIZE(tegra194_reset_sources), + .reset_levels = tegra186_reset_levels, + .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), .num_wake_events = ARRAY_SIZE(tegra194_wake_events), .wake_events = tegra194_wake_events, };
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 15 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The remainder of the file uses lower-case for hexadecimal literals, so change the only odd-one-out occurrence for consistency.
Signed-off-by Thierry Reding <[email protected]>--- drivers/soc/tegra/pmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/soc/tegra/pmc.c +0
-0
drivers/soc/tegra/pmc.c static const struct tegra_pmc_regs tegra186_pmc_regs = { · line 2811
Quoted 8 lines
drivers/soc/tegra/pmc.c +1
-1@@ -2805,7 +2805,7 @@ static const struct tegra_pmc_regs tegra186_pmc_regs = { .dpd2_status = 0x80, .rst_status = 0x70, .rst_source_shift = 0x2, - .rst_source_mask = 0x3C, + .rst_source_mask = 0x3c, .rst_level_shift = 0x0, .rst_level_mask = 0x3, };
Cheers!
Jon
Signature · 1 line
nvpublic