ARM: tegra: pinmux: Tegra210 support
Subsystems (2)
cover ARM: tegra: pinmux: Tegra210 support
From: Stephen Warren <[email protected]>
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210's e_io_hv pin option
ARM: tegra: pinmux: add Tegra210 support
arch/arm/cpu/tegra-common/pinmux-common.c | 211 ++++++++++++-- arch/arm/cpu/tegra210-common/pinmux.c | 195 +++++++++++++ arch/arm/include/asm/arch-tegra/pinmux.h | 107 ++++--- arch/arm/include/asm/arch-tegra114/pinmux.h | 14 +- arch/arm/include/asm/arch-tegra124/pinmux.h | 14 +- arch/arm/include/asm/arch-tegra20/pinmux.h | 1 + arch/arm/include/asm/arch-tegra210/pinmux.h | 416 ++++++++++++++++++++++++++++ arch/arm/include/asm/arch-tegra30/pinmux.h | 11 +- 8 files changed, 906 insertions(+), 63 deletions(-) create mode 100644 arch/arm/cpu/tegra210-common/pinmux.c create mode 100644 arch/arm/include/asm/arch-tegra210/pinmux.h
Signature · 1 line
1.9.1
PATCH 1/9 ARM: tegra: pinmux: add note re: drive group field defines
From: Stephen Warren <[email protected]>
Tegra's drive group registers have a remarkably inconsistent layout. The current U-Boot driver doesn't take this into account at all. Add a comment to describe the issue, so at least anyone debugging the driver will be aware of this. To solve this, we'd need to add a per-drive-group data structure describing the layout for the individual register. Since we don't set up too many drive groups in U-Boot at present, this hopefully isn't causing too much practical issue. Still, we probably need to fix this sometime.
Wth Tegra210, the register layout becomes almost entirely consistent, so this problem partially solves itself over time.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm/cpu/tegra-common/pinmux-common.c +15 -0
@@ -347,6 +347,21 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define SCHMT_SHIFT 3#define LPMD_SHIFT 4#define LPMD_MASK (3 << LPMD_SHIFT) +/* +* Note that the following DRV* and SLW* defines are accurate for many drive +* groups on many SoCs. We really need a per-group data structure to solve +* this, since the fields are in different positions/sizes in different +* registers (for different groups). +* +* On Tegra30/114/124, the DRV*_SHIFT values vary. +* On Tegra30, the SLW*_SHIFT values vary. +* On Tegra30/114/124/210, the DRV*_MASK values vary, although the values +* below are wide enough to cover the widest fields, and hopefully don't +* interfere with any other fields. +* On Tegra30, the SLW*_MASK values vary, but we can't use a value that's +* wide enough to cover all cases, since that would cause the field to +* overlap with other fields in the narrower cases. +*/ #define DRVDN_SHIFT 12#define DRVDN_MASK (0x7F << DRVDN_SHIFT)#define DRVUP_SHIFT 20
Signature · 1 line
1.9.1
PATCH 1/9 ARM: tegra: pinmux: add note re: drive group field defines
Hi Stephen,
Quoted 24 lines · Stephen Warren
From: Stephen Warren <[email protected]>
Tegra's drive group registers have a remarkably inconsistent layout. The current U-Boot driver doesn't take this into account at all. Add a comment to describe the issue, so at least anyone debugging the driver will be aware of this. To solve this, we'd need to add a per-drive-group data structure describing the layout for the individual register. Since we don't set up too many drive groups in U-Boot at present, this hopefully isn't causing too much practical issue. Still, we probably need to fix this sometime.
Wth Tegra210, the register layout becomes almost entirely consistent, so this problem partially solves itself over time.
Signed-off-by Stephen Warren <[email protected]>--- arch/arm/cpu/tegra-common/pinmux-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/cpu/tegra-common/pinmux-common.c +0
-0
arch/arm/cpu/tegra-common/pinmux-common.c void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config, · line 351
Quoted 5 lines
arch/arm/cpu/tegra-common/pinmux-common.c +2
-0@@ -347,6 +347,21 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define SCHMT_SHIFT 3#define LPMD_SHIFT 4#define LPMD_MASK (3 << LPMD_SHIFT) +/* +* Note that the following DRV* and SLW* defines are accurate for many drive
Do you mean 'accurate'? That seems like a good thing so wonder if this should be reworded a bit compared to your commit message.
Quoted 17 lines
arch/arm/cpu/tegra-common/pinmux-common.c +13
-1+* groups on many SoCs. We really need a per-group data structure to solve +* this, since the fields are in different positions/sizes in different +* registers (for different groups). +* +* On Tegra30/114/124, the DRV*_SHIFT values vary. +* On Tegra30, the SLW*_SHIFT values vary. +* On Tegra30/114/124/210, the DRV*_MASK values vary, although the values +* below are wide enough to cover the widest fields, and hopefully don't +* interfere with any other fields. +* On Tegra30, the SLW*_MASK values vary, but we can't use a value that's +* wide enough to cover all cases, since that would cause the field to +* overlap with other fields in the narrower cases. +*/ #define DRVDN_SHIFT 12#define DRVDN_MASK (0x7F << DRVDN_SHIFT)#define DRVUP_SHIFT 20 --
Quoted 2 lines
1.9.1
Regards,
Simon
PATCH 1/9 ARM: tegra: pinmux: add note re: drive group field defines
Quoted 22 lines · Simon Glass
Hi Stephen,
Quoted 19 lines · Stephen Warren
From: Stephen Warren <[email protected]>
Tegra's drive group registers have a remarkably inconsistent layout. The current U-Boot driver doesn't take this into account at all. Add a comment to describe the issue, so at least anyone debugging the driver will be aware of this. To solve this, we'd need to add a per-drive-group data structure describing the layout for the individual register. Since we don't set up too many drive groups in U-Boot at present, this hopefully isn't causing too much practical issue. Still, we probably need to fix this sometime.
Wth Tegra210, the register layout becomes almost entirely consistent, so this problem partially solves itself over time.
Signed-off-by Stephen Warren <[email protected]>--- arch/arm/cpu/tegra-common/pinmux-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Quoted 13 lines
arch/arm/cpu/tegra-common/pinmux-common.c void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config, · line 351
Quoted 10 lines
arch/arm/cpu/tegra-common/pinmux-common.c +2
-0@@ -347,6 +347,21 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define SCHMT_SHIFT 3#define LPMD_SHIFT 4#define LPMD_MASK (3 << LPMD_SHIFT) +/* +* Note that the following DRV* and SLW* defines are accurate for many drive Do you mean 'accurate'? That seems like a good thing so wonder if this should be reworded a bit compared to your commit message.
I think "accurate" is correct; the defines accurately describe the layout of the register in many cases, but not all. In cases where the register layout is different, the defines are not accurate for those cases. I suppose "correct" and "incorrect" would be suitable synonyms for "accurate" and "not accurate" if you wish.
Quoted 18 lines
Quoted 18 lines
arch/arm/cpu/tegra-common/pinmux-common.c +13
-1+* groups on many SoCs. We really need a per-group data structure to solve +* this, since the fields are in different positions/sizes in different +* registers (for different groups). +* +* On Tegra30/114/124, the DRV*_SHIFT values vary. +* On Tegra30, the SLW*_SHIFT values vary. +* On Tegra30/114/124/210, the DRV*_MASK values vary, although the values +* below are wide enough to cover the widest fields, and hopefully don't +* interfere with any other fields. +* On Tegra30, the SLW*_MASK values vary, but we can't use a value that's +* wide enough to cover all cases, since that would cause the field to +* overlap with other fields in the narrower cases. +*/ #define DRVDN_SHIFT 12#define DRVDN_MASK (0x7F << DRVDN_SHIFT)#define DRVUP_SHIFT 20 --1.9.1
PATCH 1/9 ARM: tegra: pinmux: add note re: drive group field defines
Hi Stephen,
Quoted 45 lines · Stephen Warren
Quoted 34 lines · Simon Glass
Hi Stephen,
Quoted 29 lines · Stephen Warren
From: Stephen Warren <[email protected]>
Tegra's drive group registers have a remarkably inconsistent layout. The current U-Boot driver doesn't take this into account at all. Add a comment to describe the issue, so at least anyone debugging the driver will be aware of this. To solve this, we'd need to add a per-drive-group data structure describing the layout for the individual register. Since we don't set up too many drive groups in U-Boot at present, this hopefully isn't causing too much practical issue. Still, we probably need to fix this sometime.
Wth Tegra210, the register layout becomes almost entirely consistent, so this problem partially solves itself over time.
Signed-off-by Stephen Warren <[email protected]>--- arch/arm/cpu/tegra-common/pinmux-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/cpu/tegra-common/pinmux-common.c +0
-0@@ -347,6 +347,21 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define SCHMT_SHIFT 3#define LPMD_SHIFT 4Quoted 8 lines
Quoted 4 lines
arch/arm/cpu/tegra-common/pinmux-common.c +2
-0#define LPMD_MASK (3 << LPMD_SHIFT) +/* +* Note that the following DRV* and SLW* defines are accurate for many drive
Do you mean 'accurate'? That seems like a good thing so wonder if this should be reworded a bit compared to your commit message.
Quoted 5 lines
I think "accurate" is correct; the defines accurately describe the layout of the register in many cases, but not all. In cases where the register layout is different, the defines are not accurate for those cases. I suppose "correct" and "incorrect" would be suitable synonyms for "accurate" and "not accurate" if you wish.
That's OK, I suppose I was expecting the comment to say that it is accurate for many but not all. But it's not important.
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
+ * groups on many SoCs. We really need a per-group data structure to solve
+ * this, since the fields are in different positions/sizes in different
+ * registers (for different groups).
+ *
+ * On Tegra30/114/124, the DRV*_SHIFT values vary.
+ * On Tegra30, the SLW*_SHIFT values vary.
+ * On Tegra30/114/124/210, the DRV*_MASK values vary, although the values
+ * below are wide enough to cover the widest fields, and hopefully
don't
+ * interfere with any other fields.
+ * On Tegra30, the SLW*_MASK values vary, but we can't use a value that's
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
+ * wide enough to cover all cases, since that would cause the field to
+ * overlap with other fields in the narrower cases.
+ */#define DRVDN_SHIFT 12 #define DRVDN_MASK (0x7F << DRVDN_SHIFT) #define DRVUP_SHIFT 20--
1.9.1
Regards,
Simon
PATCH 2/9 ARM: tegra: pinmux: simplify some defines
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
Future SoCs have a slightly different combination of pinmux options per pin. This will be simpler to handle if we simply have one define per option, rather than grouping various options together, in combinations that don't align with future chips.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 44 ++++++++++++++++++++--------- arch/arm/include/asm/arch-tegra/pinmux.h | 34 ++++++++++++++-------- arch/arm/include/asm/arch-tegra114/pinmux.h | 10 +++++-- arch/arm/include/asm/arch-tegra124/pinmux.h | 10 +++++-- arch/arm/include/asm/arch-tegra30/pinmux.h | 7 +++-- 5 files changed, 73 insertions(+), 32 deletions(-)
arch/arm/cpu/tegra-common/pinmux-common.c +31 -13
@@ -24,31 +24,37 @@#define pmux_pin_tristate_isvalid (tristate) \ (((tristate) >= PMUX_TRI_NORMAL) && ((tristate) <= PMUX_TRI_TRISTATE)) -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT /* return 1 if a pin_io_is in range */ #define pmux_pin_io_isvalid (io) \ (((io) >= PMUX_PIN_OUTPUT) && ((io) <= PMUX_PIN_INPUT)) +#endif +#ifdef TEGRA_PMX_PINS_HAVE_LOCK /* return 1 if a pin_lock is in range */ #define pmux_pin_lock_isvalid (lock) \ (((lock) >= PMUX_PIN_LOCK_DISABLE) && ((lock) <= PMUX_PIN_LOCK_ENABLE)) +#endif +#ifdef TEGRA_PMX_PINS_HAVE_OD /* return 1 if a pin_od is in range */ #define pmux_pin_od_isvalid (od) \ (((od) >= PMUX_PIN_OD_DISABLE) && ((od) <= PMUX_PIN_OD_ENABLE)) +#endif +#ifdef TEGRA_PMX_PINS_HAVE_IO_RESET /* return 1 if a pin_ioreset_is in range */ #define pmux_pin_ioreset_isvalid (ioreset) \ (((ioreset) >= PMUX_PIN_IO_RESET_DISABLE) && \ ((ioreset) <= PMUX_PIN_IO_RESET_ENABLE)) +#endif -#ifdef TEGRA_PMX_HAS_RCV_SEL +#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL /* return 1 if a pin_rcv_sel_is in range */ #define pmux_pin_rcv_sel_isvalid (rcv_sel) \ (((rcv_sel) >= PMUX_PIN_RCV_SEL_NORMAL) && \ ((rcv_sel) <= PMUX_PIN_RCV_SEL_HIGH)) -#endif /* TEGRA_PMX_HAS_RCV_SEL */ -#endif /* TEGRA_PMX_HAS_PIN_IO_BIT_ETC */ +#endif #define _R (offset) (u32 *)(NV_PA_APB_MISC_BASE + (offset))
@@ -86,7 +92,7 @@#define IO_RESET_SHIFT 8#define RCV_SEL_SHIFT 9 -#if !defined(CONFIG_TEGRA20 ) && !defined(CONFIG_TEGRA30 ) +#ifdef TEGRA_PMX_SOC_HAS_IO_CLAMPING /* This register/field only exists on Tegra114 and later */ #define APB_MISC_PP_PINMUX_GLOBAL_0 0x40#define CLAMP_INPUTS_WHEN_TRISTATED 1
@@ -180,7 +186,7 @@ void pinmux_tristate_disable(enum pmux_pingrp pin)pinmux_set_tristate (pin,PMUX_TRI_NORMAL ); } -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT void pinmux_set_io (enum pmux_pingrp pin,enum pmux_pin_io io) {u32 *reg =REG (pin);
@@ -200,7 +206,9 @@ void pinmux_set_io(enum pmux_pingrp pin, enum pmux_pin_io io) val &= ~(1 <<IO_SHIFT );writel (val, reg); } +#endif +#ifdef TEGRA_PMX_PINS_HAVE_LOCK static void pinmux_set_lock (enum pmux_pingrp pin,enum pmux_pin_lock lock) {u32 *reg =REG (pin);
@@ -225,7 +233,9 @@ static void pinmux_set_lock(enum pmux_pingrp pin, enum pmux_pin_lock lock)return ; } +#endif +#ifdef TEGRA_PMX_PINS_HAVE_OD static void pinmux_set_od (enum pmux_pingrp pin,enum pmux_pin_od od) {u32 *reg =REG (pin);
@@ -247,7 +257,9 @@ static void pinmux_set_od(enum pmux_pingrp pin, enum pmux_pin_od od)return ; } +#endif +#ifdef TEGRA_PMX_PINS_HAVE_IO_RESET static void pinmux_set_ioreset (enum pmux_pingrp pin,enum pmux_pin_ioreset ioreset) {
@@ -270,8 +282,9 @@ static void pinmux_set_ioreset(enum pmux_pingrp pin,return ; } +#endif -#ifdef TEGRA_PMX_HAS_RCV_SEL +#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL static void pinmux_set_rcv_sel (enum pmux_pingrp pin,enum pmux_pin_rcv_sel rcv_sel) {
@@ -294,8 +307,7 @@ static void pinmux_set_rcv_sel(enum pmux_pingrp pin, return; } -#endif /* TEGRA_PMX_HAS_RCV_SEL */ -#endif /* TEGRA_PMX_HAS_PIN_IO_BIT_ETC */ +#endif static void pinmux_config_pingrp (const struct pmux_pingrp_config *config) {
@@ -304,14 +316,20 @@ static void pinmux_config_pingrp(const struct pmux_pingrp_config *config)pinmux_set_func (pin, config->func);pinmux_set_pullupdown (pin, config->pull);pinmux_set_tristate (pin, config->tristate); -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT pinmux_set_io (pin, config->io); +#endif +#ifdef TEGRA_PMX_PINS_HAVE_LOCK pinmux_set_lock (pin, config->lock); +#endif +#ifdef TEGRA_PMX_PINS_HAVE_OD pinmux_set_od (pin, config->od); +#endif +#ifdef TEGRA_PMX_PINS_HAVE_IO_RESET pinmux_set_ioreset (pin, config->ioreset); -#ifdef TEGRA_PMX_HAS_RCV_SEL -pinmux_set_rcv_sel (pin, config->rcv_sel);#endif +#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL +pinmux_set_rcv_sel (pin, config->rcv_sel);#endif }
@@ -324,7 +342,7 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,pinmux_config_pingrp (&config[i]); } -#ifdef TEGRA_PMX_HAS_DRVGRPS +#ifdef TEGRA_PMX_SOC_HAS_DRVGRPS #define pmux_drvgrp_isvalid (pd) (((pd) >= 0) && ((pd) < PMUX_DRVGRP_COUNT))
arch/arm/include/asm/arch-tegra/pinmux.h +23 -11
@@ -23,39 +23,45 @@ enum pmux_tristate { PMUX_TRI_TRISTATE = 1, }; -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT enum pmux_pin_io {PMUX_PIN_OUTPUT =0 ,PMUX_PIN_INPUT =1 ,PMUX_PIN_NONE , }; +#endif +#ifdef TEGRA_PMX_PINS_HAVE_LOCK enum pmux_pin_lock {PMUX_PIN_LOCK_DEFAULT =0 ,PMUX_PIN_LOCK_DISABLE ,PMUX_PIN_LOCK_ENABLE , }; +#endif +#ifdef TEGRA_PMX_PINS_HAVE_OD enum pmux_pin_od {PMUX_PIN_OD_DEFAULT =0 ,PMUX_PIN_OD_DISABLE ,PMUX_PIN_OD_ENABLE , }; +#endif +#ifdef TEGRA_PMX_PINS_HAVE_IO_RESET enum pmux_pin_ioreset {PMUX_PIN_IO_RESET_DEFAULT =0 ,PMUX_PIN_IO_RESET_DISABLE ,PMUX_PIN_IO_RESET_ENABLE , }; +#endif -#ifdef TEGRA_PMX_HAS_RCV_SEL +#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL enum pmux_pin_rcv_sel {PMUX_PIN_RCV_SEL_DEFAULT =0 ,PMUX_PIN_RCV_SEL_NORMAL ,PMUX_PIN_RCV_SEL_HIGH , }; -#endif /* TEGRA_PMX_HAS_RCV_SEL */ -#endif /* TEGRA_PMX_HAS_PIN_IO_BIT_ETC */ +#endif /* * This defines the configuration for a pin, including the function assigned,
@@ -68,19 +74,25 @@ struct pmux_pingrp_config { u32 func:8; /* function to assign PMUX_FUNC_... */ u32 pull:2; /* pull up/down/normal PMUX_PULL_...*/ u32 tristate:2; /* tristate or normal PMUX_TRI_... */ -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT u32 io:2; /* input or output PMUX_PIN_... */ +#endif +#ifdef TEGRA_PMX_PINS_HAVE_LOCK u32 lock:2; /* lock enable/disable PMUX_PIN... */ +#endif +#ifdef TEGRA_PMX_PINS_HAVE_OD u32 od:2; /* open-drain or push-pull driver */ +#endif +#ifdef TEGRA_PMX_PINS_HAVE_IO_RESET u32 ioreset:2; /* input/output reset PMUX_PIN... */ -#ifdef TEGRA_PMX_HAS_RCV_SEL +#endif +#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL u32 rcv_sel:2; /* select between High and Normal *//* VIL/VIH receivers */ #endif -#endif }; -#if !defined(CONFIG_TEGRA20 ) && !defined(CONFIG_TEGRA30 ) +#ifdef TEGRA_PMX_SOC_HAS_IO_CLAMPING /* Set/clear the pinmux CLAMP_INPUTS_WHEN_TRISTATED bit */ void pinmux_set_tristate_input_clamping (void );void pinmux_clear_tristate_input_clamping (void );
@@ -98,7 +110,7 @@ void pinmux_tristate_enable(enum pmux_pingrp pin);/* Set a pin group to normal (non tristate) */ void pinmux_tristate_disable (enum pmux_pingrp pin); -#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC +#ifdef TEGRA_PMX_PINS_HAVE_E_INPUT /* Set a pin group as input or output */ void pinmux_set_io (enum pmux_pingrp pin,enum pmux_pin_io io);#endif
@@ -112,7 +124,7 @@ void pinmux_set_io(enum pmux_pingrp pin, enum pmux_pin_io io);void pinmux_config_pingrp_table (const struct pmux_pingrp_config *config,int len); -#ifdef TEGRA_PMX_HAS_DRVGRPS +#ifdef TEGRA_PMX_SOC_HAS_DRVGRPS #define PMUX_SLWF_MIN 0#define PMUX_SLWF_MAX 3
@@ -176,7 +188,7 @@ struct pmux_drvgrp_config {void pinmux_config_drvgrp_table (const struct pmux_drvgrp_config *config,int len); -#endif /* TEGRA_PMX_HAS_DRVGRPS */ +#endif /* TEGRA_PMX_SOC_HAS_DRVGRPS */ struct pmux_pingrp_desc {u8 funcs[4 ];
arch/arm/include/asm/arch-tegra114/pinmux.h +7 -3
@@ -313,9 +313,13 @@ enum pmux_func { PMUX_FUNC_COUNT, }; -#define TEGRA_PMX_HAS_PIN_IO_BIT_ETC -#define TEGRA_PMX_HAS_RCV_SEL -#define TEGRA_PMX_HAS_DRVGRPS +#define TEGRA_PMX_SOC_HAS_IO_CLAMPING +#define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_PINS_HAVE_E_INPUT +#define TEGRA_PMX_PINS_HAVE_LOCK +#define TEGRA_PMX_PINS_HAVE_OD +#define TEGRA_PMX_PINS_HAVE_IO_RESET +#define TEGRA_PMX_PINS_HAVE_RCV_SEL #include <asm/arch-tegra/pinmux.h> #endif /* _TEGRA114_PINMUX_H_ */
arch/arm/include/asm/arch-tegra124/pinmux.h +7 -3
@@ -335,9 +335,13 @@ enum pmux_func { PMUX_FUNC_COUNT, }; -#define TEGRA_PMX_HAS_PIN_IO_BIT_ETC -#define TEGRA_PMX_HAS_RCV_SEL -#define TEGRA_PMX_HAS_DRVGRPS +#define TEGRA_PMX_SOC_HAS_IO_CLAMPING +#define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_PINS_HAVE_E_INPUT +#define TEGRA_PMX_PINS_HAVE_LOCK +#define TEGRA_PMX_PINS_HAVE_OD +#define TEGRA_PMX_PINS_HAVE_IO_RESET +#define TEGRA_PMX_PINS_HAVE_RCV_SEL #include <asm/arch-tegra/pinmux.h> #endif /* _TEGRA124_PINMUX_H_ */
arch/arm/include/asm/arch-tegra30/pinmux.h +5 -2
@@ -391,8 +391,11 @@ enum pmux_func { PMUX_FUNC_COUNT, }; -#define TEGRA_PMX_HAS_PIN_IO_BIT_ETC -#define TEGRA_PMX_HAS_DRVGRPS +#define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_PINS_HAVE_E_INPUT +#define TEGRA_PMX_PINS_HAVE_LOCK +#define TEGRA_PMX_PINS_HAVE_OD +#define TEGRA_PMX_PINS_HAVE_IO_RESET #include <asm/arch-tegra/pinmux.h> #endif /* _TEGRA30_PINMUX_H_ */
Signature · 1 line
1.9.1
PATCH 3/9 ARM: tegra: pinmux: handle feature removal on newer SoCs
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
On some future SoCs, some of the per-drive-group features no longer exist. Add some ifdefs to support this.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 24 ++++++++++++++++++++++++ arch/arm/include/asm/arch-tegra/pinmux.h | 12 ++++++++++++ arch/arm/include/asm/arch-tegra114/pinmux.h | 3 +++ arch/arm/include/asm/arch-tegra124/pinmux.h | 3 +++ arch/arm/include/asm/arch-tegra30/pinmux.h | 3 +++ 5 files changed, 45 insertions(+)
arch/arm/cpu/tegra-common/pinmux-common.c +24 -0
@@ -352,19 +352,31 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define pmux_drv_isvalid (drv) \ (((drv) >= PMUX_DRVUP_MIN) && ((drv) <= PMUX_DRVUP_MAX)) +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD #define pmux_lpmd_isvalid (lpm) \ (((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X)) +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT #define pmux_schmt_isvalid (schmt) \ (((schmt) >= PMUX_SCHMT_DISABLE) && ((schmt) <= PMUX_SCHMT_ENABLE)) +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM #define pmux_hsm_isvalid (hsm) \ (((hsm) >= PMUX_HSM_DISABLE) && ((hsm) <= PMUX_HSM_ENABLE)) +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM #define HSM_SHIFT 2 +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT #define SCHMT_SHIFT 3 +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD #define LPMD_SHIFT 4#define LPMD_MASK (3 << LPMD_SHIFT) +#endif /* * Note that the following DRV* and SLW* defines are accurate for many drive * groups on many SoCs. We really need a per-group data structure to solve
@@ -473,6 +485,7 @@ static void pinmux_set_drvdn(enum pmux_drvgrp grp, int drvdn)return ; } +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD static void pinmux_set_lpmd (enum pmux_drvgrp grp,enum pmux_lpmd lpmd) {u32 *reg =DRV_REG (grp);
@@ -493,7 +506,9 @@ static void pinmux_set_lpmd(enum pmux_drvgrp grp, enum pmux_lpmd lpmd)return ; } +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT static void pinmux_set_schmt (enum pmux_drvgrp grp,enum pmux_schmt schmt) {u32 *reg =DRV_REG (grp);
@@ -516,7 +531,9 @@ static void pinmux_set_schmt(enum pmux_drvgrp grp, enum pmux_schmt schmt)return ; } +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM static void pinmux_set_hsm (enum pmux_drvgrp grp,enum pmux_hsm hsm) {u32 *reg =DRV_REG (grp);
@@ -539,6 +556,7 @@ static void pinmux_set_hsm(enum pmux_drvgrp grp, enum pmux_hsm hsm) return; } +#endif static void pinmux_config_drvgrp (const struct pmux_drvgrp_config *config) {
@@ -548,9 +566,15 @@ static void pinmux_config_drvgrp(const struct pmux_drvgrp_config *config)pinmux_set_drvdn_slwr (grp, config->slwr);pinmux_set_drvup (grp, config->drvup);pinmux_set_drvdn (grp, config->drvdn); +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD pinmux_set_lpmd (grp, config->lpmd); +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT pinmux_set_schmt (grp, config->schmt); +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM pinmux_set_hsm (grp, config->hsm); +#endif } void pinmux_config_drvgrp_table(const struct pmux_drvgrp_config *config,
arch/arm/include/asm/arch-tegra/pinmux.h +12 -0
@@ -142,6 +142,7 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define PMUX_DRVDN_MAX 127#define PMUX_DRVDN_NONE -1 +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD /* Defines a pin group cfg's low-power mode select */ enum pmux_lpmd { PMUX_LPMD_X8 = 0,
@@ -150,20 +151,25 @@ enum pmux_lpmd {PMUX_LPMD_X , PMUX_LPMD_NONE = -1, }; +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT /* Defines whether a pin group cfg's schmidt is enabled or not */ enum pmux_schmt {PMUX_SCHMT_DISABLE =0 ,PMUX_SCHMT_ENABLE =1 ,PMUX_SCHMT_NONE =-1 , }; +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM /* Defines whether a pin group cfg's high-speed mode is enabled or not */ enum pmux_hsm {PMUX_HSM_DISABLE =0 ,PMUX_HSM_ENABLE =1 ,PMUX_HSM_NONE =-1 , }; +#endif /* * This defines the configuration for a pin group's pad control config
@@ -174,9 +180,15 @@ struct pmux_drvgrp_config { u32 slwr:3; /* rising edge slew */ u32 drvup:8; /* pull-up drive strength */ u32 drvdn:8; /* pull-down drive strength */ +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD u32 lpmd:3; /* low-power mode selection */ +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT u32 schmt:2; /* schmidt enable */ +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_HSM u32 hsm:2; /* high-speed mode enable */ +#endif };/**
arch/arm/include/asm/arch-tegra114/pinmux.h +3 -0
@@ -315,6 +315,9 @@ enum pmux_func {#define TEGRA_PMX_SOC_HAS_IO_CLAMPING #define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_GRPS_HAVE_LPMD +#define TEGRA_PMX_GRPS_HAVE_SCHMT +#define TEGRA_PMX_GRPS_HAVE_HSM #define TEGRA_PMX_PINS_HAVE_E_INPUT #define TEGRA_PMX_PINS_HAVE_LOCK #define TEGRA_PMX_PINS_HAVE_OD
arch/arm/include/asm/arch-tegra124/pinmux.h +3 -0
@@ -337,6 +337,9 @@ enum pmux_func {#define TEGRA_PMX_SOC_HAS_IO_CLAMPING #define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_GRPS_HAVE_LPMD +#define TEGRA_PMX_GRPS_HAVE_SCHMT +#define TEGRA_PMX_GRPS_HAVE_HSM #define TEGRA_PMX_PINS_HAVE_E_INPUT #define TEGRA_PMX_PINS_HAVE_LOCK #define TEGRA_PMX_PINS_HAVE_OD
arch/arm/include/asm/arch-tegra30/pinmux.h +3 -0
@@ -392,6 +392,9 @@ enum pmux_func { };#define TEGRA_PMX_SOC_HAS_DRVGRPS +#define TEGRA_PMX_GRPS_HAVE_LPMD +#define TEGRA_PMX_GRPS_HAVE_SCHMT +#define TEGRA_PMX_GRPS_HAVE_HSM #define TEGRA_PMX_PINS_HAVE_E_INPUT #define TEGRA_PMX_PINS_HAVE_LOCK #define TEGRA_PMX_PINS_HAVE_OD
Signature · 1 line
1.9.1
PATCH 4/9 ARM: tegra: pinmux: move some type definitions
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
On some future SoCs, some per-drive-group features became per-pin features. Move all type definitions early in the header so they can be enabled irrespective of the setting of TEGRA_PMX_SOC_HAS_DRVGRPS.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 30 ++++++++-------- arch/arm/include/asm/arch-tegra/pinmux.h | 58 +++++++++++++++---------------- 2 files changed, 44 insertions(+), 44 deletions(-)
arch/arm/cpu/tegra-common/pinmux-common.c +15 -15
@@ -56,6 +56,21 @@ ((rcv_sel) <= PMUX_PIN_RCV_SEL_HIGH))#endif +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD +#define pmux_lpmd_isvalid (lpm) \ + (((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X)) +#endif + +#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT +#define pmux_schmt_isvalid (schmt) \ + (((schmt) >= PMUX_SCHMT_DISABLE) && ((schmt) <= PMUX_SCHMT_ENABLE)) +#endif + +#ifdef TEGRA_PMX_GRPS_HAVE_HSM +#define pmux_hsm_isvalid (hsm) \ + (((hsm) >= PMUX_HSM_DISABLE) && ((hsm) <= PMUX_HSM_ENABLE)) +#endif +#define _R (offset) (u32 *)(NV_PA_APB_MISC_BASE + (offset))#if defined(CONFIG_TEGRA20 )
@@ -352,21 +367,6 @@ void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,#define pmux_drv_isvalid (drv) \ (((drv) >= PMUX_DRVUP_MIN) && ((drv) <= PMUX_DRVUP_MAX)) -#ifdef TEGRA_PMX_GRPS_HAVE_LPMD -#define pmux_lpmd_isvalid (lpm) \ - (((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X)) -#endif - -#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT -#define pmux_schmt_isvalid (schmt) \ - (((schmt) >= PMUX_SCHMT_DISABLE) && ((schmt) <= PMUX_SCHMT_ENABLE)) -#endif - -#ifdef TEGRA_PMX_GRPS_HAVE_HSM -#define pmux_hsm_isvalid (hsm) \ - (((hsm) >= PMUX_HSM_DISABLE) && ((hsm) <= PMUX_HSM_ENABLE)) -#endif -#ifdef TEGRA_PMX_GRPS_HAVE_HSM #define HSM_SHIFT 2#endif
arch/arm/include/asm/arch-tegra/pinmux.h +29 -29
70 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 5/9 ARM: tegra: pinmux: partially handle varying register layouts
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
Tegra210 moves some bits around in the pinmux registers. Update the code to handle this.
This doesn't attempt to address the issues with the group-to-group varying drive group register layout mentioned earlier. This patch handles the SoC-to-SoC differences in the mux register layout.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/cpu/tegra-common/pinmux-common.c +12 -0
@@ -101,11 +101,23 @@#define DRV_REG (group) _R(0x868 + ((group) * 4)) +/* +* We could force arch-tegraNN/pinmux.h to define all of these. However, +* that's a lot of defines, and for now it's manageable to just put a +* special case here. It's possible this decision will change with future +* SoCs. +*/ +#ifdef CONFIG_TEGRA210 +#define IO_SHIFT 6 +#define LOCK_SHIFT 7 +#define OD_SHIFT 11 +#else #define IO_SHIFT 5#define OD_SHIFT 6#define LOCK_SHIFT 7#define IO_RESET_SHIFT 8#define RCV_SEL_SHIFT 9 +#endif #ifdef TEGRA_PMX_SOC_HAS_IO_CLAMPING /* This register/field only exists on Tegra114 and later */
Signature · 1 line
1.9.1
PATCH 6/9 ARM: tegra: pinmux: support hsm/schmitt on pins
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
T210 support HSM and Schmitt options in the pinmux register (previous chips placed these options in the drive group register). Update the code to handle this.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 66 ++++++++++++++++++++++++++++++- arch/arm/include/asm/arch-tegra/pinmux.h | 10 ++++- 2 files changed, 72 insertions(+), 4 deletions(-)
arch/arm/cpu/tegra-common/pinmux-common.c +64 -2
@@ -61,12 +61,12 @@ (((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X))#endif -#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT +#if defined(TEGRA_PMX_PINS_HAVE_SCHMT ) || defined(TEGRA_PMX_GRPS_HAVE_SCHMT )#define pmux_schmt_isvalid (schmt) \ (((schmt) >= PMUX_SCHMT_DISABLE) && ((schmt) <= PMUX_SCHMT_ENABLE))#endif -#ifdef TEGRA_PMX_GRPS_HAVE_HSM +#if defined(TEGRA_PMX_PINS_HAVE_HSM ) || defined(TEGRA_PMX_GRPS_HAVE_HSM )#define pmux_hsm_isvalid (hsm) \ (((hsm) >= PMUX_HSM_DISABLE) && ((hsm) <= PMUX_HSM_ENABLE))#endif
@@ -110,7 +110,13 @@#ifdef CONFIG_TEGRA210 #define IO_SHIFT 6#define LOCK_SHIFT 7 +#ifdef TEGRA_PMX_PINS_HAVE_HSM +#define HSM_SHIFT 9 +#endif #define OD_SHIFT 11 +#ifdef TEGRA_PMX_PINS_HAVE_SCHMT +#define SCHMT_SHIFT 12 +#endif #else #define IO_SHIFT 5#define OD_SHIFT 6
@@ -336,6 +342,56 @@ static void pinmux_set_rcv_sel(enum pmux_pingrp pin, }#endif +#ifdef TEGRA_PMX_PINS_HAVE_SCHMT +static void pinmux_set_schmt (enum pmux_pingrp pin,enum pmux_schmt schmt) +{ +u32 *reg =REG (grp); +u32 val; + +/* NONE means unspecified/do not change/use POR value */ +if (schmt ==PMUX_SCHMT_NONE ) +return ; + +/* Error check pad */ +assert (pmux_pingrp_isvalid (pin)); +assert (pmux_schmt_isvalid (schmt)); + + val =readl (reg); +if (schmt ==PMUX_SCHMT_ENABLE ) + val |= (1 <<SCHMT_SHIFT ); +else + val &= ~(1 <<SCHMT_SHIFT ); +writel (val, reg); + +return ; +} +#endif + +#ifdef TEGRA_PMX_PINS_HAVE_HSM +static void pinmux_set_hsm (enum pmux_pingrp pin,enum pmux_hsm hsm) +{ +u32 *reg =REG (grp); +u32 val; + +/* NONE means unspecified/do not change/use POR value */ +if (hsm ==PMUX_HSM_NONE ) +return ; + +/* Error check pad */ +assert (pmux_pingrp_isvalid (pin)); +assert (pmux_hsm_isvalid (hsm)); + + val =readl (reg); +if (hsm ==PMUX_HSM_ENABLE ) + val |= (1 <<HSM_SHIFT ); +else + val &= ~(1 <<HSM_SHIFT ); +writel (val, reg); + +return ; +} +#endif +static void pinmux_config_pingrp (const struct pmux_pingrp_config *config) {enum pmux_pingrp pin = config->pingrp;
@@ -358,6 +414,12 @@ static void pinmux_config_pingrp(const struct pmux_pingrp_config *config)#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL pinmux_set_rcv_sel (pin, config->rcv_sel);#endif +#ifdef TEGRA_PMX_PINS_HAVE_SCHMT +pinmux_set_schmt (pin, config->schmt); +#endif +#ifdef TEGRA_PMX_PINS_HAVE_HSM +pinmux_set_hsm (pin, config->hsm); +#endif } void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,
arch/arm/include/asm/arch-tegra/pinmux.h +8 -2
@@ -74,7 +74,7 @@ enum pmux_lpmd { };#endif -#ifdef TEGRA_PMX_GRPS_HAVE_SCHMT +#if defined(TEGRA_PMX_PINS_HAVE_SCHMT ) || defined(TEGRA_PMX_GRPS_HAVE_SCHMT )/* Defines whether a pin group cfg's schmidt is enabled or not */ enum pmux_schmt { PMUX_SCHMT_DISABLE = 0,
@@ -83,7 +83,7 @@ enum pmux_schmt { };#endif -#ifdef TEGRA_PMX_GRPS_HAVE_HSM +#if defined(TEGRA_PMX_PINS_HAVE_HSM ) || defined(TEGRA_PMX_GRPS_HAVE_HSM )/* Defines whether a pin group cfg's high-speed mode is enabled or not */ enum pmux_hsm { PMUX_HSM_DISABLE = 0,
@@ -119,6 +119,12 @@ struct pmux_pingrp_config { u32 rcv_sel:2; /* select between High and Normal *//* VIL/VIH receivers */ #endif +#ifdef TEGRA_PMX_PINS_HAVE_SCHMT + u32 schmt:2; /* schmitt enable */ +#endif +#ifdef TEGRA_PMX_PINS_HAVE_HSM + u32 hsm:2; /* high-speed mode enable */ +#endif };#ifdef TEGRA_PMX_SOC_HAS_IO_CLAMPING
Signature · 1 line
1.9.1
PATCH 7/9 ARM: tegra: pinmux: account for different drivegroup base registers
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
Tegra210 starts its drive group registers at a different offset from the APB MISC register block that other SoCs. Update the code to handle this.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 2 +- arch/arm/include/asm/arch-tegra114/pinmux.h | 1 + arch/arm/include/asm/arch-tegra124/pinmux.h | 1 + arch/arm/include/asm/arch-tegra20/pinmux.h | 1 + arch/arm/include/asm/arch-tegra30/pinmux.h | 1 + 5 files changed, 5 insertions(+), 1 deletion(-)
arch/arm/cpu/tegra-common/pinmux-common.c +1 -1
@@ -99,7 +99,7 @@#endif /* CONFIG_TEGRA20 */ -#define DRV_REG (group) _R(0x868 + ((group) * 4)) +#define DRV_REG (group) _R(TEGRA_PMX_SOC_DRV_GROUP_BASE_REG + ((group) * 4))/* * We could force arch-tegraNN/pinmux.h to define all of these. However,
arch/arm/include/asm/arch-tegra114/pinmux.h +1 -0
@@ -313,6 +313,7 @@ enum pmux_func { PMUX_FUNC_COUNT, }; +#define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868#define TEGRA_PMX_SOC_HAS_IO_CLAMPING #define TEGRA_PMX_SOC_HAS_DRVGRPS #define TEGRA_PMX_GRPS_HAVE_LPMD
arch/arm/include/asm/arch-tegra124/pinmux.h +1 -0
@@ -335,6 +335,7 @@ enum pmux_func { PMUX_FUNC_COUNT, }; +#define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868#define TEGRA_PMX_SOC_HAS_IO_CLAMPING #define TEGRA_PMX_SOC_HAS_DRVGRPS #define TEGRA_PMX_GRPS_HAVE_LPMD
arch/arm/include/asm/arch-tegra20/pinmux.h +1 -0
@@ -233,6 +233,7 @@ enum pmux_func { PMUX_FUNC_COUNT, }; +#define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868#include <asm/arch-tegra/pinmux.h> #endif /* _TEGRA20_PINMUX_H_ */
arch/arm/include/asm/arch-tegra30/pinmux.h +1 -0
@@ -391,6 +391,7 @@ enum pmux_func { PMUX_FUNC_COUNT, }; +#define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868#define TEGRA_PMX_SOC_HAS_DRVGRPS #define TEGRA_PMX_GRPS_HAVE_LPMD #define TEGRA_PMX_GRPS_HAVE_SCHMT
Signature · 1 line
1.9.1
PATCH 8/9 ARM: tegra: pinmux: support Tegra210's e_io_hv pin option
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
Tegra210 has a per-pin option named e_io_hv, which indicates that the pin's input path should be configured to be 3.3v-tolerant. Add support for this.
Note that this is very similar to previous chip's rcv_sel option. However, since the Tegra TRM names this option differently for the different chips, we support the new name so that the code exactly matches the naming in the TRM, to avoid confusion.
This patch incorporates a few fixes from Tom Warren <[email protected]>.
--- arch/arm/cpu/tegra-common/pinmux-common.c | 36 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-tegra/pinmux.h | 11 ++++++++++ 2 files changed, 47 insertions(+)
arch/arm/cpu/tegra-common/pinmux-common.c +36 -0
@@ -56,6 +56,13 @@ ((rcv_sel) <= PMUX_PIN_RCV_SEL_HIGH))#endif +#ifdef TEGRA_PMX_PINS_HAVE_E_IO_HV +/* return 1 if a pin_e_io_hv is in range */ +#define pmux_pin_e_io_hv_isvalid (e_io_hv) \ + (((e_io_hv) >= PMUX_PIN_E_IO_HV_NORMAL) && \ + ((e_io_hv) <= PMUX_PIN_E_IO_HV_HIGH)) +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD #define pmux_lpmd_isvalid (lpm) \ (((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X))
@@ -113,6 +120,7 @@#ifdef TEGRA_PMX_PINS_HAVE_HSM #define HSM_SHIFT 9#endif +#define E_IO_HV_SHIFT 10#define OD_SHIFT 11#ifdef TEGRA_PMX_PINS_HAVE_SCHMT #define SCHMT_SHIFT 12
@@ -342,6 +350,31 @@ static void pinmux_set_rcv_sel(enum pmux_pingrp pin, }#endif +#ifdef TEGRA_PMX_PINS_HAVE_E_IO_HV +static void pinmux_set_e_io_hv (enum pmux_pingrp pin, +enum pmux_pin_e_io_hv e_io_hv) +{ +u32 *reg =REG (pin); +u32 val; + +if (e_io_hv ==PMUX_PIN_E_IO_HV_DEFAULT ) +return ; + +/* Error check on pin and e_io_hv */ +assert (pmux_pingrp_isvalid (pin)); +assert (pmux_pin_e_io_hv_isvalid (e_io_hv)); + + val =readl (reg); +if (e_io_hv ==PMUX_PIN_E_IO_HV_HIGH ) + val |= (1 <<E_IO_HV_SHIFT ); +else + val &= ~(1 <<E_IO_HV_SHIFT ); +writel (val, reg); + +return ; +} +#endif +#ifdef TEGRA_PMX_PINS_HAVE_SCHMT static void pinmux_set_schmt (enum pmux_pingrp pin,enum pmux_schmt schmt) {
@@ -414,6 +447,9 @@ static void pinmux_config_pingrp(const struct pmux_pingrp_config *config)#ifdef TEGRA_PMX_PINS_HAVE_RCV_SEL pinmux_set_rcv_sel (pin, config->rcv_sel);#endif +#ifdef TEGRA_PMX_PINS_HAVE_E_IO_HV +pinmux_set_e_io_hv (pin, config->e_io_hv); +#endif #ifdef TEGRA_PMX_PINS_HAVE_SCHMT pinmux_set_schmt (pin, config->schmt);#endif
arch/arm/include/asm/arch-tegra/pinmux.h +11 -0
@@ -63,6 +63,14 @@ enum pmux_pin_rcv_sel { };#endif +#ifdef TEGRA_PMX_PINS_HAVE_E_IO_HV +enum pmux_pin_e_io_hv { +PMUX_PIN_E_IO_HV_DEFAULT =0 , +PMUX_PIN_E_IO_HV_NORMAL , +PMUX_PIN_E_IO_HV_HIGH , +}; +#endif +#ifdef TEGRA_PMX_GRPS_HAVE_LPMD /* Defines a pin group cfg's low-power mode select */ enum pmux_lpmd {
@@ -119,6 +127,9 @@ struct pmux_pingrp_config { u32 rcv_sel:2; /* select between High and Normal *//* VIL/VIH receivers */ #endif +#ifdef TEGRA_PMX_PINS_HAVE_E_IO_HV + u32 e_io_hv:2; /* select 3.3v tolerant receivers */ +#endif #ifdef TEGRA_PMX_PINS_HAVE_SCHMT u32 schmt:2; /* schmitt enable */#endif
Signature · 1 line
1.9.1
PATCH 9/9 ARM: tegra: pinmux: add Tegra210 support
In reply to Stephen WarrenFrom: Stephen Warren <[email protected]>
This patch incorporates a few fixes from Tom Warren <[email protected]>.
--- arch/arm/cpu/tegra210-common/pinmux.c | 195 +++++++++++++ arch/arm/include/asm/arch-tegra210/pinmux.h | 416 ++++++++++++++++++++++++++++ 2 files changed, 611 insertions(+) create mode 100644 arch/arm/cpu/tegra210-common/pinmux.c create mode 100644 arch/arm/include/asm/arch-tegra210/pinmux.h
arch/arm/cpu/tegra210-common/pinmux.c new file +195 -0
@@ -0,0 +1,195 @@ +/* +* Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/pinmux.h> + +#define PIN (pin, f0, f1, f2, f3) \ + { \ + .funcs = { \ + PMUX_FUNC_##f0, \ + PMUX_FUNC_##f1, \ + PMUX_FUNC_##f2, \ + PMUX_FUNC_##f3, \ + }, \ + } + +#define PIN_RESERVED {} + +static const struct pmux_pingrp_desc tegra210_pingroups[] = { +/* pin, f0, f1, f2, f3 */ +/* Offset 0x3000 */ +PIN (SDMMC1_CLK_PM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,RSVD2 ,RSVD3 ), +}; +const struct pmux_pingrp_desc *tegra_soc_pingroups = tegra210_pingroups;
arch/arm/include/asm/arch-tegra210/pinmux.h new file +416 -0
416 lines not on this page · raw message
Signature · 1 line
1.9.1
cover ARM: tegra: pinmux: Tegra210 support
In reply to Stephen WarrenHi Stephen,
Quoted 13 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Quoted 10 lines
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210'se_io_hvpin option
ARM: tegra: pinmux: add Tegra210 support
Does the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way.
It feels like maybe we need to define an API that would suit all Tegra chips?
Quoted 13 lines
arch/arm/cpu/tegra-common/pinmux-common.c | 211 ++++++++++++-- arch/arm/cpu/tegra210-common/pinmux.c | 195 +++++++++++++ arch/arm/include/asm/arch-tegra/pinmux.h | 107 ++++--- arch/arm/include/asm/arch-tegra114/pinmux.h | 14 +- arch/arm/include/asm/arch-tegra124/pinmux.h | 14 +- arch/arm/include/asm/arch-tegra20/pinmux.h | 1 + arch/arm/include/asm/arch-tegra210/pinmux.h | 416 ++++++++++++++++++++++++++++ arch/arm/include/asm/arch-tegra30/pinmux.h | 11 +- 8 files changed, 906 insertions(+), 63 deletions(-) create mode 100644 arch/arm/cpu/tegra210-common/pinmux.c create mode 100644 arch/arm/include/asm/arch-tegra210/pinmux.h
Quoted 3 lines
--
1.9.1
Regards,
Simon
cover ARM: tegra: pinmux: Tegra210 support
Quoted 27 lines · Simon Glass
Hi Stephen,
Quoted 13 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Quoted 10 lines
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210'se_io_hvpin option
ARM: tegra: pinmux: add Tegra210 support
Quoted 5 lines
Does the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way.
It feels like maybe we need to define an API that would suit all Tegra chips?
The Linux side was already a bit more parameterized, so the Tegra210 support series doesn't have as many patches as the U-Boot series. However, that comes at the cost of the per-SoC "drivers" having much larger data tables, so I don't expect we'd want to adopt in U-Boot the same level of driver parameterization as Linux.
You can find the kernel patches on the linux-tegra mailing list; I posted them roughly the same time as the U-Boot patches.
The U-Boot API to the pinmux driver is already identical across all chips (at least Tegra114+; Tegra20 and perhaps Tegra30 boards might use some more fine-grained APIs in what I'd assert is a legacy fashion); the board file simply calls gpio_config_table(), pinmux_config_pingrp_table(), and pinmux_config_drvgrp_table(), passing the relevant data table to each. The only difference between SoCs is the set of fields in the data table, since each SoC has a different feature set. While we could reduce the number of ifdefs and unify the structs across chips, this would be at the cost of bloating structs with fields that aren't supported, and including functions to apply settings that will never be used by any pin's data table entries, thus using more .text and .rodata space without good reason.
cover ARM: tegra: pinmux: Tegra210 support
Hi Stephen,
Quoted 41 lines · Stephen Warren
Quoted 32 lines · Simon Glass
Hi Stephen,
Quoted 15 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Quoted 10 lines
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210'se_io_hvpin option
ARM: tegra: pinmux: add Tegra210 supportQuoted 6 lines
Does the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way.
It feels like maybe we need to define an API that would suit all Tegra chips?
Quoted 5 lines
The Linux side was already a bit more parameterized, so the Tegra210 support series doesn't have as many patches as the U-Boot series. However, that comes at the cost of the per-SoC "drivers" having much larger data tables, so I don't expect we'd want to adopt in U-Boot the same level of driver parameterization as Linux.
I see - do you know how much bigger the tables are?
Quoted 4 lines
You can find the kernel patches on the linux-tegra mailing list; I posted them roughly the same time as the U-Boot patches.
Quoted 11 lines
The U-Boot API to the pinmux driver is already identical across all chips (at least Tegra114+; Tegra20 and perhaps Tegra30 boards might use some more fine-grained APIs in what I'd assert is a legacy fashion); the board file simply calls
gpio_config_table(),pinmux_config_pingrp_table(), andpinmux_config_drvgrp_table(), passing the relevant data table to each. The only difference between SoCs is the set of fields in the data table, since each SoC has a different feature set. While we could reduce the number of ifdefs and unify the structs across chips, this would be at the cost of bloating structs with fields that aren't supported, and including functions to apply settings that will never be used by any pin's data table entries, thus using more .text and .rodata space without good reason.
OK, well that's up to you, I suppose I was talking about the lower-level API, and probably that ties in with the discussion about a pinctl layer. Let's see what happens in the future.
Regards,
Simon
cover ARM: tegra: pinmux: Tegra210 support
Quoted 8 lines · Simon Glass
Quoted 7 lines · Stephen Warren
Quoted 6 lines · Simon Glass
Quoted 4 lines · Stephen Warren
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
...
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210'se_io_hvpin option
ARM: tegra: pinmux: add Tegra210 supportDoes the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way.
...
Quoted 7 lines
Quoted 5 lines
The Linux side was already a bit more parameterized, so the Tegra210 support series doesn't have as many patches as the U-Boot series. However, that comes at the cost of the per-SoC "drivers" having much larger data tables, so I don't expect we'd want to adopt in U-Boot the same level of driver parameterization as Linux.
I see - do you know how much bigger the tables are?
Kernel per-SoC files:
text data bss dec hex filename 25532 1068 0 26600 67e8 pinctrl-tegra30.o 18744 1032 0 19776 4d40 pinctrl-tegra114.o 19868 1128 0 20996 5204 pinctrl-tegra124.o
16296 972 0 17268 4374 pinctrl-tegra210.o
U-Boot per-SoC files, although these could actually be reduced to zero if we re-wrote the per-board pinmux tables to use FUNC0..3 enums (i.e. raw HW register mux values) and hence got rid of the need to map a mux enum to FUNC0..3 values. Auto-generation of the per-board files would make pretty easy, if all boards were in tegra-pinmux-scripts.
text data bss dec hex filename
996 4 0 1000 3e8 .../tegra30/pinmux.o
1036 4 0 1040 410 .../tegra114/pinmux.o
1076 4 0 1080 438 .../tegra124/pinmux.ocover ARM: tegra: pinmux: Tegra210 support
Hi Stephen,
Quoted 47 lines · Stephen Warren
Quoted 8 lines · Simon Glass
Quoted 7 lines · Stephen Warren
Quoted 6 lines · Simon Glass
Quoted 4 lines · Stephen Warren
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
...
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Stephen Warren (9):
ARM: tegra: pinmux: add note re: drive group field defines
ARM: tegra: pinmux: simplify some defines
ARM: tegra: pinmux: handle feature removal on newer SoCs
ARM: tegra: pinmux: move some type definitions
ARM: tegra: pinmux: partially handle varying register layouts
ARM: tegra: pinmux: support hsm/schmitt on pins
ARM: tegra: pinmux: account for different drivegroup base registers
ARM: tegra: pinmux: support Tegra210'se_io_hvpin option
ARM: tegra: pinmux: add Tegra210 supportDoes the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way.
...
Quoted 7 lines
Quoted 5 lines
The Linux side was already a bit more parameterized, so the Tegra210 support series doesn't have as many patches as the U-Boot series. However, that comes at the cost of the per-SoC "drivers" having much larger data tables, so I don't expect we'd want to adopt in U-Boot the same level of driver parameterization as Linux.
I see - do you know how much bigger the tables are?
Kernel per-SoC files:
text data bss dec hex filename 25532 1068 0 26600 67e8 pinctrl-tegra30.o 18744 1032 0 19776 4d40 pinctrl-tegra114.o 19868 1128 0 20996 5204 pinctrl-tegra124.o16296 972 0 17268 4374 pinctrl-tegra210.o
U-Boot per-SoC files, although these could actually be reduced to zero if we re-wrote the per-board pinmux tables to use FUNC0..3 enums (i.e. raw HW register mux values) and hence got rid of the need to map a mux enum to FUNC0..3 values. Auto-generation of the per-board files would make pretty easy, if all boards were in tegra-pinmux-scripts.
Quoted 4 lines
text data bss dec hex filename
996 4 0 1000 3e8 .../tegra30/pinmux.o
1036 4 0 1040 410 .../tegra114/pinmux.o
1076 4 0 1080 438 .../tegra124/pinmux.oWow that's pretty compelling! I suppose removing the #ifdefs wouldn't bloat it that much, but it sounds like we should stick with what you have.
Regards,
Simon
cover ARM: tegra: pinmux: Tegra210 support
In reply to Stephen WarrenQuoted 10 lines · Stephen Warren
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon.
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Tom,
Are you waiting for anything before applying this series?
cover ARM: tegra: pinmux: Tegra210 support
I'm using this locally, so I'll apply it and push a new u-boot-tegra/next.
Quoted 17 lines
-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Tuesday, March 03, 2015 1:20 PM
To: Tom Warren
Cc: u-boot at lists.denx.de; Simon Glass; Stephen Warren
Subject: Re: [U-Boot] [PATCH 0/9] ARM: tegra: pinmux: Tegra210 supportQuoted 4 lines · Stephen Warren
This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing
soon.
Quoted 4 lines
I've at least compile-tested this by over-writing the Tegra124 pinmux driver and Jetson TK1 board pinmux data tables with the Tegra210 versions.
Quoted 6 lines
Quoted 2 lines
TomW, note I made a couple minor tweaks since the latest version I sent internally; let's apply this version upstream.
Tom,
Are you waiting for anything before applying this series?
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------