summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-31 10:17:14 -0600
committerTom Rini <[email protected]>2025-12-31 11:51:15 -0600
commit601733e7087286f211634204c60fe86856ddbd78 (patch)
treec522ca6c5614799346e067247061f69bda0e6914 /drivers
parent101d0cc6812bd13a528b5ea0e5b020f388cd16f6 (diff)
parent80430530996b672c5ea30257b95f3682f2d326cd (diff)
Merge patch series "modify npcm7xx/8xx feature and bug fixed"
Jim Liu <[email protected]> says: Modify npcm7xx/8xx features and bug fixes. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/npcm_sgpio.c8
-rw-r--r--drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c6
-rw-r--r--drivers/watchdog/npcm_wdt.c23
3 files changed, 12 insertions, 25 deletions
diff --git a/drivers/gpio/npcm_sgpio.c b/drivers/gpio/npcm_sgpio.c
index fcc42087d57..d0fad08be07 100644
--- a/drivers/gpio/npcm_sgpio.c
+++ b/drivers/gpio/npcm_sgpio.c
@@ -301,7 +301,7 @@ static bool is_gpio_persist(struct udevice *dev)
status = npcm_get_reset_status();
if (status & PORST)
- return false;
+ return true;
if (status & CORST)
regmap_read(priv->rst_regmap, CORSTC, &val);
else if (status & WD0RST)
@@ -320,9 +320,9 @@ static bool is_gpio_persist(struct udevice *dev)
regmap_read(priv->rst_regmap, TIPRSTC, &val);
if (priv->siox_num == 1)
- return (val && BIT(NPCM_SIOX2));
+ return !!(val & BIT(NPCM_SIOX2));
else
- return (val && BIT(NPCM_SIOX1));
+ return !!(val & BIT(NPCM_SIOX1));
}
static const struct dm_gpio_ops npcm_sgpio_ops = {
@@ -363,7 +363,7 @@ static int npcm_sgpio_probe(struct udevice *dev)
uc_priv->gpio_count = priv->nin_sgpio + priv->nout_sgpio;
uc_priv->bank_name = dev->name;
- if (is_gpio_persist(dev)) {
+ if (!is_gpio_persist(dev)) {
ofnode_for_each_subnode(node, dev_ofnode(dev)) {
if (ofnode_read_bool(node, "persist-enable")) {
rc = ofnode_read_u32_array(node, "gpios", val, 2);
diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
index c960ca3393d..29536f556ad 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
@@ -166,6 +166,8 @@ struct npcm8xx_pinctrl_priv {
213, 214, 215) \
FUNC(spix, MFSEL4, 27, 224, 225, 226, 227, 229, 230) \
FUNC(spixcs1, MFSEL4, 28, 228) \
+ FUNC(smb11ddcm, MFSEL4, 29) \
+ FUNC(smb11ddcs, MFSEL4, 30) \
FUNC(spi1cs1, MFSEL5, 0, 233) \
FUNC(jm2, MFSEL5, 1) \
FUNC(j2j3, MFSEL5, 2, 44, 62, 45, 46) \
@@ -570,9 +572,9 @@ static const struct pin_info npcm8xx_pins[] = {
{189, "GPIO189/SPI3_D3/SPI3_nCS3", {FN_spi3quad, FN_spi3cs3, FN_gpio1889}, 3,
DS(8, 12) | SLEW | GPIO_ALT | GPIO_IDX(2)},
{190, "GPIO190/nPRD_SMI", {FN_nprd_smi}, 1, DS(2, 4)},
- {191, "GPIO191/SPI1_D1/FANIN17/FM1_D1/STRAP10",
+ {191, "GPIO191/SPI1_D2/SPI1_nCS2/FM1_D2/SMB15B_SDA",
{FN_spi1d23, FN_spi1cs2, FN_fm1, FN_smb15}, 4, SLEW},
- {192, "GPIO192/SPI1_D3/SPI_nCS3/FM1_D3/SMB15_SCL",
+ {192, "GPIO192/SPI1_D3/SPI_nCS3/FM1_D3/SMB15B_SCL",
{FN_spi1d23, FN_spi1cs3, FN_fm1, FN_smb15}, 4, SLEW},
{193, "GPIO193/R1_CRSDV", {FN_r1}, 1, 0},
{194, "GPIO194/SMB0B_SCL/FM0_CK", {FN_smb0b, FN_fm0}, 2, SLEW},
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c
index 57b61215a2a..7becc646fda 100644
--- a/drivers/watchdog/npcm_wdt.c
+++ b/drivers/watchdog/npcm_wdt.c
@@ -27,26 +27,11 @@ struct npcm_wdt_priv {
static int npcm_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
{
struct npcm_wdt_priv *priv = dev_get_priv(dev);
- u32 time_out, val;
+ u32 val;
- time_out = (u32)(timeout_ms) / 1000;
- if (time_out < 2)
- val = 0x800;
- else if (time_out < 3)
- val = 0x420;
- else if (time_out < 6)
- val = 0x810;
- else if (time_out < 11)
- val = 0x430;
- else if (time_out < 22)
- val = 0x820;
- else if (time_out < 44)
- val = 0xc00;
- else if (time_out < 87)
- val = 0x830;
- else if (time_out < 173)
- val = 0xc10;
- else if (time_out < 688)
+ if (timeout_ms < 343552)
+ val = ((timeout_ms / 1342) << 16) + 0x800;
+ else if (timeout_ms < 688000)
val = 0xc20;
else
val = 0xc30;