soc: Add support for Parked bits for Tegra210
PATCH 1/1 soc: Add support for Parked bits for Tegra210
Tegra210 has a parked bit for each pin. Add code to express this by updating the kernel driver MACROs to add in parked_* fields so that the kernel can handle them as it sees fit.
--- configs/tegra114.soc | 3 +++ configs/tegra124.soc | 3 +++ configs/tegra210.soc | 3 +++ configs/tegra30.soc | 3 +++ soc-to-kernel-pinctrl-driver.py | 12 ++++++++++++ tegra_pmx_soc_parser.py | 3 +++ 6 files changed, 27 insertions(+)
configs/tegra114.soc +3 -0
@@ -21,9 +21,12 @@ soc_pins_have_ior = True soc_pins_have_od = True soc_pins_have_rcv_sel = True soc_pins_have_schmitt = False +soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0 gpios = ( #name, gpio, reg, f0, f1, f2, f3, od, ior, rcv_sel
configs/tegra124.soc +3 -0
@@ -22,10 +22,13 @@ soc_pins_have_ior = True soc_pins_have_od = True soc_pins_have_rcv_sel = True soc_pins_have_schmitt = False +soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_mipipadctrl_reg_base = 0x820 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0 gpios = ( #name, gpio, reg, f0, f1, f2, f3, od, ior, rcv_sel
configs/tegra210.soc +3 -0
@@ -18,9 +18,12 @@ soc_pins_have_ior = False soc_pins_have_od = True soc_pins_have_rcv_sel = False soc_pins_have_schmitt = True +soc_pins_have_parked = True soc_drv_reg_base = 0x8d4 soc_einput_b = 6 soc_odrain_b = 11 +soc_parked_bank = 1 +soc_parked_bit = 5 gpios = ( #name, gpio, reg, f0, f1, f2, f3, hsm, drvtype, e_io_hv
configs/tegra30.soc +3 -0
@@ -18,9 +18,12 @@ soc_pins_have_ior = True soc_pins_have_od = True soc_pins_have_rcv_sel = False soc_pins_have_schmitt = False +soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0 gpios = ( #name, gpio, reg, f0, f1, f2, f3, od, ior
soc-to-kernel-pinctrl-driver.py +12 -0
@@ -259,6 +259,17 @@ s += '''\ .rcv_sel_bit = %(rcv_sel_val)s ''' % globals() +if soc.soc_pins_have_parked: + s += '''\ + .parked_reg = PINGROUP_REG(r), + .parked_bank = %s, + .parked_bit = %s, +''' % (soc.soc_parked_bank, soc.soc_parked_bit) +else: + s+= '''\ + .parked_reg = -1, +''' + if soc.soc_pins_have_hsm: s += '''\ .hsm_bit = PINGROUP_BIT_##hsm(9),
@@ -358,6 +369,7 @@ s += '''\ .rcv_sel_bit = -1, .drv_reg = DRV_PINGROUP_REG(r), .drv_bank = 0, + .parked_reg = -1, .hsm_bit = %(hsm_bit_val)s, .schmitt_bit = %(schmitt_bit_val)s, .lpmd_bit = %(lpmd_bit_val)s,
tegra_pmx_soc_parser.py +3 -0
@@ -158,10 +158,13 @@ class Soc(TopLevelParsedObj): ('soc_pins_have_od', None), ('soc_pins_have_rcv_sel', None), ('soc_pins_have_schmitt', None), + ('soc_pins_have_parked', None), ('soc_drv_reg_base', None), ('soc_mipipadctrl_reg_base', 0), ('soc_einput_b', None), ('soc_odrain_b', None), + ('soc_parked_bank', None), + ('soc_parked_bit', None), ) TopLevelParsedObj.__init__(self, name, copy_attrs, data)
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1460060143-25086-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Quoted 3 lines · Rhyland Klein
Tegra210 has a parked bit for each pin. Add code to express this by updating the kernel driver MACROs to add in parked_* fields so that the kernel can handle them as it sees fit.
I'd expect that wrapped around 74 characters. Our internal git auto-review thing's 50-character limit is a bit odd (I think it's only meant to apply to the synopsis not the full description but is either buggy or just doesn't make that clear).
configs/tegra114.soc soc_pins_have_ior = True · line 29
Quoted 8 lines
configs/tegra114.soc +3
-0+soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0
For SoCs with soc_pins_have_parked == False, can we simply omit the bank/bit values from the config file?
Other than that, I think this looks good. Thanks for taking the time to update it.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Stephen Warren
Quoted 3 lines · Rhyland Klein
Tegra210 has a parked bit for each pin. Add code to express this by updating the kernel driver MACROs to add in parked_* fields so that the kernel can handle them as it sees fit.
I'd expect that wrapped around 74 characters. Our internal git auto-review thing's 50-character limit is a bit odd (I think it's only meant to apply to the synopsis not the full description but is either buggy or just doesn't make that clear).
I'll fix the wrapping.
Quoted 12 lines
configs/tegra114.soc soc_pins_have_ior = True · line 29
Quoted 9 lines
configs/tegra114.soc +3
-0+soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0For SoCs with
soc_pins_have_parked== False, can we simply omit the bank/bit values from the config file?
I tried that originally, but I don't think I can. The reason is that tegra_pmx_soc_parser uses a predefined array of attributes (copy_attrs) and if the entry isn't in that, then it won't be populated and can't be accessed later to fill in the values for say T210. If the entry IS in the copy_attrs, then the script will fail if there isn't an entry in the config file. Its unfortunate, and maybe someone more familiar with the scripts might know of a way to get around this, something I haven't found yet.
-rhyland
Signature · 1 line
nvpublic
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Rhyland Klein
Quoted 9 lines · Stephen Warren
Quoted 3 lines · Rhyland Klein
Tegra210 has a parked bit for each pin. Add code to express this by updating the kernel driver MACROs to add in parked_* fields so that the kernel can handle them as it sees fit.
I'd expect that wrapped around 74 characters. Our internal git auto-review thing's 50-character limit is a bit odd (I think it's only meant to apply to the synopsis not the full description but is either buggy or just doesn't make that clear).
I'll fix the wrapping.
Quoted 12 lines
configs/tegra114.soc soc_pins_have_ior = True · line 29
Quoted 9 lines
configs/tegra114.soc +3
-0+soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0For SoCs with
soc_pins_have_parked== False, can we simply omit the bank/bit values from the config file?
Quoted 8 lines
I tried that originally, but I don't think I can. The reason is that
tegra_pmx_soc_parseruses a predefined array of attributes (copy_attrs) and if the entry isn't in that, then it won't be populated and can't be accessed later to fill in the values for say T210. If the entry IS in thecopy_attrs, then the script will fail if there isn't an entry in the config file. Its unfortunate, and maybe someone more familiar with the scripts might know of a way to get around this, something I haven't found yet.
Oh yes, you're right; the parsing is all in one pass so we can't check for the "have" attribute first and then conditionally act upon it to copy the _b attributes.
But now you made me look at the code, I noticed that I think the new Boolean value should be named soc_pins_all_have_parked, and the new entry in copy_attrs should be sorted next to the existing soc_pins_all_have_* entries:-) (That's because the _b value applies to all pins, and is defined once at the SoC level, rather than potentially having a different value per pin).
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 40 lines · Stephen Warren
Quoted 26 lines · Rhyland Klein
Quoted 9 lines · Stephen Warren
Quoted 3 lines · Rhyland Klein
Tegra210 has a parked bit for each pin. Add code to express this by updating the kernel driver MACROs to add in parked_* fields so that the kernel can handle them as it sees fit.
I'd expect that wrapped around 74 characters. Our internal git auto-review thing's 50-character limit is a bit odd (I think it's only meant to apply to the synopsis not the full description but is either buggy or just doesn't make that clear).
I'll fix the wrapping.
Quoted 12 lines
configs/tegra114.soc
Quoted 9 lines
configs/tegra114.soc +3
-0+soc_pins_have_parked = False soc_drv_reg_base = 0x868 soc_einput_b = 5 soc_odrain_b = 6 +soc_parked_bank = 0 +soc_parked_bit = 0For SoCs with
soc_pins_have_parked== False, can we simply omit the bank/bit values from the config file?Quoted 8 lines
I tried that originally, but I don't think I can. The reason is that
tegra_pmx_soc_parseruses a predefined array of attributes (copy_attrs) and if the entry isn't in that, then it won't be populated and can't be accessed later to fill in the values for say T210. If the entry IS in thecopy_attrs, then the script will fail if there isn't an entry in the config file. Its unfortunate, and maybe someone more familiar with the scripts might know of a way to get around this, something I haven't found yet.Oh yes, you're right; the parsing is all in one pass so we can't check for the "have" attribute first and then conditionally act upon it to copy the _b attributes.
Quoted 6 lines
But now you made me look at the code, I noticed that I think the new Boolean value should be named
soc_pins_all_have_parked, and the new entry incopy_attrsshould be sorted next to the existing soc_pins_all_have_* entries:-) (That's because the _b value applies to all pins, and is defined once at the SoC level, rather than potentially having a different value per pin).
Sure I can rename that. Makes sense.
-rhyland
Signature · 1 line
nvpublic