drivers: pinctrl: Update ambiq nce definitions in pinctrl

Updated nce definitions in pinctrl structure to be consistent
with ambiq HAL.

Signed-off-by: Hao Luo <hluo@ambiq.com>
This commit is contained in:
Hao Luo 2025-04-14 20:23:17 +08:00 committed by Benjamin Cabé
commit a499afde23
10 changed files with 42 additions and 43 deletions

View file

@ -125,7 +125,7 @@
pinmux = <NCE19_P19>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <0>;
ambiq,nce-src = <0>;
ambiq,iom-num = <6>;
};
};

View file

@ -126,7 +126,7 @@
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-mspi = <0>;
ambiq,iom-nce-module = <0>;
ambiq,nce-src = <0>;
ambiq,iom-num = <0>;
};
};
@ -147,7 +147,7 @@
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-mspi = <0>;
ambiq,iom-nce-module = <0>;
ambiq,nce-src = <0>;
ambiq,iom-num = <1>;
};
};
@ -164,7 +164,7 @@
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-mspi = <0>;
ambiq,iom-nce-module = <0>;
ambiq,nce-src = <0>;
ambiq,iom-num = <2>;
};
};

View file

@ -128,7 +128,7 @@
pinmux = <NCE57_P57>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <32>;
ambiq,nce-src = <32>;
};
};
mspi1_default: mspi1_default{
@ -141,7 +141,7 @@
pinmux = <NCE56_P56>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <34>;
ambiq,nce-src = <34>;
};
};
mspi2_default: mspi2_default{
@ -154,7 +154,7 @@
pinmux = <NCE52_P52>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <36>;
ambiq,nce-src = <36>;
};
};

View file

@ -142,7 +142,7 @@
pinmux = <NCE57_P57>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <32>;
ambiq,nce-src = <32>;
};
};
mspi1_default: mspi1_default{
@ -155,7 +155,7 @@
pinmux = <NCE56_P56>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <34>;
ambiq,nce-src = <34>;
};
};
mspi2_default: mspi2_default{
@ -168,7 +168,7 @@
pinmux = <NCE0_P0>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <36>;
ambiq,nce-src = <36>;
};
};
sdio0_default: sdio0_default {

View file

@ -108,7 +108,7 @@
pinmux = <NCE19_P19>;
drive-push-pull;
drive-strength = "0.5";
ambiq,iom-nce-module = <0>;
ambiq,nce-src = <0>;
ambiq,iom-num = <6>;
};
};

View file

@ -22,7 +22,8 @@ static void pinctrl_configure_pin(const pinctrl_soc_pin_t *pin)
: pin->tristate ? AM_HAL_GPIO_PIN_OUTCFG_TRISTATE
: AM_HAL_GPIO_PIN_OUTCFG_DISABLE;
pin_config.eDriveStrength = pin->drive_strength;
pin_config.uNCE = pin->iom_nce;
pin_config.uNCE = pin->nce;
pin_config.eCEpol = pin->nce_pol;
#if defined(CONFIG_SOC_APOLLO3P_BLUE)
pin_config.bIomMSPIn = pin->iom_mspi;
#endif
@ -42,9 +43,11 @@ static void pinctrl_configure_pin(const pinctrl_soc_pin_t *pin)
: pin->tristate ? AM_HAL_GPIO_PIN_OUTCFG_TRISTATE
: AM_HAL_GPIO_PIN_OUTCFG_DISABLE;
pin_config.GP.cfg_b.eDriveStrength = pin->drive_strength;
#if defined(CONFIG_SOC_SERIES_APOLLO4X)
pin_config.GP.cfg_b.uSlewRate = pin->slew_rate;
pin_config.GP.cfg_b.uNCE = pin->iom_nce;
pin_config.GP.cfg_b.eIntDir = pin->interrupt_direction;
#endif
pin_config.GP.cfg_b.uNCE = pin->nce;
pin_config.GP.cfg_b.eCEpol = pin->nce_pol;
if (pin->bias_pull_up) {
pin_config.GP.cfg_b.ePullup = pin->ambiq_pull_up_ohms + AM_HAL_GPIO_PIN_PULLUP_1_5K;

View file

@ -98,7 +98,7 @@ child-binding:
For Apollo3 these pins are 0-1,5-6,8-9,25,27,39-40,42-43,48-49.
The default value is 1500 ohms, which is the reset value of
register PADREGx.PADxRSEL.
ambiq,iom-nce-module:
ambiq,nce-src:
type: int
default: 0
description: |
@ -125,3 +125,10 @@ child-binding:
information and config the pins accordingly, we give a default value
0 here to make it be consistent with AM_HAL_GPIO_PINCFG_DEFAULT in
ambiq hal. If the pin is not a CE, this descriptor will be ignored.
ambiq,nce-pol:
type: int
default: 0
description: |
Polarity select for NCE
LOW = 0x0 - Polarity is active low
HIGH = 0x1 - Polarity is active high

View file

@ -104,7 +104,7 @@ child-binding:
default: 1500
description: |
The pullup resistor value. The default value is 1500 ohms.
ambiq,iom-nce-module:
ambiq,nce-src:
type: int
default: 0
description: |
@ -154,24 +154,10 @@ child-binding:
42, DC_RESX : DC module RESX
If the pin is not a CE, this descriptor will be ignored.
Default value 0, which is the reset value.
ambiq,iom-mspi:
ambiq,nce-pol:
type: int
default: 0
description: |
Indicates the module which uses specific CE pin, 1 if CE is IOM, 0 if MSPI.
Default value 0, which is the reset value.
If the pin is not a CE, this descriptor will be ignored.
ambiq,iom-num:
type: int
default: 0
description: |
Indicates the instance which uses specific CE pin.
IOM number (0-7) or MSPI (0-2).
Default value 0, which is the reset value.
If the pin is not a CE, this descriptor will be ignored.
ambiq,interrupt-direction:
type: int
default: 0
description: |
Indicates the pininterrupt direction.
Default value 0, which is the reset value.
Polarity select for NCE
LOW = 0x0 - Polarity is active low
HIGH = 0x1 - Polarity is active high

View file

@ -33,12 +33,14 @@ struct apollo3_pinctrl_soc_pin {
uint32_t bias_pull_down: 1;
/** pullup resistor value */
uint32_t ambiq_pull_up_ohms: 3;
/** IOM nCE module select */
uint32_t iom_nce: 2;
/** nCE module select */
uint32_t nce: 2;
/** IOM or MSPI */
uint32_t iom_mspi: 1;
/** IOM/MSPI instance number */
uint32_t iom_num: 3;
/** nCE module polarity */
uint32_t nce_pol: 1;
};
typedef struct apollo3_pinctrl_soc_pin pinctrl_soc_pin_t;
@ -62,9 +64,10 @@ typedef struct apollo3_pinctrl_soc_pin pinctrl_soc_pin_t;
DT_PROP(node_id, bias_pull_up), \
DT_PROP(node_id, bias_pull_down), \
DT_ENUM_IDX(node_id, ambiq_pull_up_ohms), \
DT_PROP(node_id, ambiq_iom_nce_module), \
DT_PROP(node_id, ambiq_nce_src), \
DT_PROP(node_id, ambiq_iom_mspi), \
DT_PROP(node_id, ambiq_iom_num), \
DT_PROP(node_id, ambiq_nce_pol), \
},
/**

View file

@ -35,10 +35,10 @@ struct apollo4_pinctrl_soc_pin {
uint32_t bias_pull_down : 1;
/** pullup resistor value */
uint32_t ambiq_pull_up_ohms : 3;
/** IOM nCE module select */
uint32_t iom_nce : 6;
/** IOM interrupt direction */
uint32_t interrupt_direction: 2;
/** nCE module select */
uint32_t nce : 6;
/** nCE module polarity */
uint32_t nce_pol: 1;
};
typedef struct apollo4_pinctrl_soc_pin pinctrl_soc_pin_t;
@ -63,8 +63,8 @@ typedef struct apollo4_pinctrl_soc_pin pinctrl_soc_pin_t;
DT_PROP(node_id, bias_pull_up), \
DT_PROP(node_id, bias_pull_down), \
DT_ENUM_IDX(node_id, ambiq_pull_up_ohms), \
DT_PROP(node_id, ambiq_iom_nce_module), \
DT_PROP(node_id, ambiq_interrupt_direction), \
DT_PROP(node_id, ambiq_nce_src), \
DT_PROP(node_id, ambiq_nce_pol), \
},
/**