Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"

J. Neuschäfer <j.ne@posteo.net> says:

This patchset contains a few small fixes/cleanups for the MPC83xx
platform.

Link: https://lore.kernel.org/r/20241220-mpc83xx-misc-v2-0-ff4c17ee5fa4@posteo.net
This commit is contained in:
Tom Rini 2024-12-30 15:55:33 -06:00
commit ad09ccf7fe
4 changed files with 18 additions and 7 deletions

View file

@ -13,7 +13,7 @@
#define SPCR_TSECBDP_MASK 0x00000C00 #define SPCR_TSECBDP_MASK 0x00000C00
#define SPCR_TSECEP_MASK 0x00000300 #define SPCR_TSECEP_MASK 0x00000300
const __be32 spcr_mask = static const __be32 spcr_mask =
#if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET) #if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET)
SPCR_OPT_MASK | SPCR_OPT_MASK |
#endif #endif
@ -27,7 +27,7 @@
SPCR_TSEC2EP_MASK | SPCR_TSEC2EP_MASK |
#endif #endif
0; 0;
const __be32 spcr_val = static const __be32 spcr_val =
#if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET) #if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET)
CONFIG_SPCR_OPT | CONFIG_SPCR_OPT |
#endif #endif
@ -42,7 +42,7 @@
#endif #endif
0; 0;
const __be32 lcrr_mask = static const __be32 lcrr_mask =
#if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET) #if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET)
LCRR_DBYP | LCRR_DBYP |
#endif #endif
@ -60,7 +60,7 @@
#endif #endif
0; 0;
const __be32 lcrr_val = static const __be32 lcrr_val =
#if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET) #if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET)
CONFIG_LCRR_DBYP | CONFIG_LCRR_DBYP |
#endif #endif

View file

@ -12,6 +12,7 @@
#include <asm/global_data.h> #include <asm/global_data.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "initreg/initreg.h"
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
@ -29,7 +30,7 @@ void interrupt_init_cpu (unsigned *decrementer_count)
/* Enable e300 time base */ /* Enable e300 time base */
immr->sysconf.spcr |= 0x00400000; immr->sysconf.spcr |= SPCR_TBEN_MASK;
} }
/* /*

View file

@ -204,7 +204,17 @@ static int mpc8xxx_gpio_plat_to_priv(struct udevice *dev)
return -ENOMEM; return -ENOMEM;
priv->gpio_count = plat->ngpios; priv->gpio_count = plat->ngpios;
priv->dat_shadow = 0;
/*
* On platforms that do support reading back output values, we want to
* try preserving them, so that we don't accidentally set unrelated
* GPIOs to zero in mpc8xxx_gpio_set_value.
*/
if (priv->little_endian)
priv->dat_shadow = in_le32(&priv->base->gpdat) & in_le32(&priv->base->gpdir);
else
priv->dat_shadow = in_be32(&priv->base->gpdat) & in_be32(&priv->base->gpdir);
priv->type = driver_data; priv->type = driver_data;

View file

@ -206,7 +206,7 @@ static u64 mpc83xx_timer_get_count(struct udevice *dev)
tbl = mftb(); tbl = mftb();
} while (tbu != mftbu()); } while (tbu != mftbu());
return (tbu * 0x10000ULL) + tbl; return (uint64_t)tbu << 32 | tbl;
} }
static int mpc83xx_timer_probe(struct udevice *dev) static int mpc83xx_timer_probe(struct udevice *dev)