History log of /linux-master/arch/powerpc/platforms/52xx/mpc52xx_common.c
Revision Date Author Comments
# 4d57e351 10-Mar-2023 Rob Herring <robh@kernel.org>

powerpc: Use of_property_read_bool() for boolean properties

It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230310144659.1541127-1-robh@kernel.org


# 6d056b72 07-May-2022 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

powerpc/52xx: Remove dead code, i.e. mpc52xx_get_xtal_freq()

It seems mpc52xx_get_xtal_freq() is not used anywhere. Remove dead code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220507100147.5802-1-andriy.shevchenko@linux.intel.com


# e6f6390a 08-Mar-2022 Christophe Leroy <christophe.leroy@csgroup.eu>

powerpc: Add missing headers

Don't inherit headers "by chances" from asm/prom.h, asm/mpc52xx.h,
asm/pci.h etc...

Include the needed headers, and remove asm/prom.h when it was
needed exclusively for pulling necessary headers.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/be8bdc934d152a7d8ee8d1a840d5596e2f7d85e0.1646767214.git.christophe.leroy@csgroup.eu


# 1fd02f66 30-Apr-2022 Julia Lawall <Julia.Lawall@inria.fr>

powerpc: fix typos in comments

Various spelling mistakes in comments.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220430185654.5855-1-Julia.Lawall@inria.fr


# 95ec77c0 11-Jul-2016 Daniel Axtens <dja@axtens.net>

powerpc: Make ppc_md.{halt, restart} __noreturn

powernv marks it's halt and restart calls as __noreturn. However,
ppc_md does not have this annotation. Add the annotation to ppc_md,
and then to every halt/restart function that is missing it.

Additionally, I have verified that all of these functions do not
return. Occasionally I have added a spin loop to be sure.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# ce6d73c9 10-Sep-2014 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

powerpc: make of_device_ids const

of_device_ids (i.e. compatible strings and the respective data) are not
supposed to change at runtime. All functions working with of_device_ids
provided by <linux/of.h> work with const of_device_ids. This allows to
mark all struct of_device_id const, too.

While touching these line also put the __init annotation at the right
position where necessary.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# ff651516 21-Jun-2011 Grant Likely <grant.likely@secretlab.ca>

powerpc/5200: convert mpc5200 to use of_platform_populate()

of_platform_populate() also handles nodes at the root of the tree,
which is wanted for things like describing the sound complex. This
patch converts mpc5200 support to use of_platform_populate() instead
of of_platform_bus_probe().

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Anatolij Gustschin <agust@denx.de>


# 66b15db6 27-May-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: add export.h to files making use of EXPORT_SYMBOL

With module.h being implicitly everywhere via device.h, the absence
of explicitly including something for EXPORT_SYMBOL went unnoticed.
Since we are heading to fix things up and clean module.h from the
device.h file, we need to explicitly include these files now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# fa32154e 03-Sep-2010 Eric Millbrandt <emillbrandt@dekaresearch.com>

powerpc/5200: tighten up ac97 reset timing

Tighten up time timing around the gpio reset functionality. Add a 200ns
delay before remuxing the pins back to ac97 to comply with the ac97 spec.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# cfa6a88c 06-Aug-2010 Eric Millbrandt <emillbrandt@dekaresearch.com>

powerpc/5200: add mpc5200_psc_ac97_gpio_reset

Work around a silicon bug in the ac97 reset functionality of the
mpc5200(b). The implementation of the ac97 "cold" reset is flawed.
If the sync and output lines are high when reset is asserted the
attached ac97 device may go into test mode. Avoid this by
reconfiguring the psc to gpio mode and generating the reset manually.

From MPC5200B User's Manual:
"Some AC97 devices goes to a test mode, if the Sync line is high
during the Res line is low (reset phase). To avoid this behavior the
Sync line must be also forced to zero during the reset phase. To do
that, the pin muxing should switch to GPIO mode and the GPIO control
register should be used to control the output lines."

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 87c441e5 17-Jun-2009 Wolfgang Denk <wd@denx.de>

powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function

So far, MPC512x used mpc512x_find_ips_freq() to get the bus frequency,
while MPC52xx used mpc52xx_find_ipb_freq(). Despite the different
clock names (IPS vs. IPB) the code was identical.

Use common code for both processor families.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# df8a95f4 11-Mar-2009 Wolfgang Grandegger <wg@grandegger.com>

powerpc/5200: add function to return external clock frequency

This patch adds the utility function mpc52xx_get_xtal_freq() to get
the frequency of the external oscillator clock connected to the pin
SYS_XTAL_IN. The MSCAN may us it as clock source. Unfortunately, this
value is not available from the FDT blob, but it can be determined
from the IPB frequency.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# aafbf16b 26-Feb-2009 Grant Likely <grant.likely@secretlab.ca>

powerpc/5200: Add 'simple-bus' to the of_platform probe list.

To better match the ePAPR specification, device nodes which claim
"simple-bus" compatibility should be probed by default.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 2701a1ad 24-Dec-2008 Julia Lawall <julia@diku.dk>

powerpc/52xx: Use DEFINE_SPINLOCK

SPIN_LOCK_UNLOCKED is deprecated. The following makes the change suggested
in Documentation/spinlocks.txt

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
declarer name DEFINE_SPINLOCK;
identifier xxx_lock;
@@

- spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
+ DEFINE_SPINLOCK(xxx_lock);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 96290957 15-Oct-2008 Wolfram Sang <wsa@kernel.org>

powerpc/mpc5200: Don't touch pipelining for MPC5200B

MPC5200 needs to have pipelining disabled for ATA to work. MPC5200B does not.
So, for the latter, don't touch the original setting from the bootloader.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# f43c32ef 08-Oct-2008 Wolfram Sang <wsa@kernel.org>

powerpc/mpc5200: trivial printk-fixes in mpc52xx_common

- one printk was missing a loglevel
- remove double space while we are here

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 4187377b 23-Feb-2008 Eric Dujardin <eric.dujardin@sagem.com>

[POWERPC] Add export for mpc52xx_set_psc_clkdiv

mpc52xx_set_psc_clkdiv is needed by PSC device drivers.

Signed-off-by: Eric Dujardin <eric.dujardin@sagem.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# c8004a28 24-Jan-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Add common clock setting routine mpc52xx_psc_set_clkdiv()

PSC drivers should not access the CDM registers directly. Instead provide
a common routine for setting the PSC clock parameters with the required
locking.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 66ffbe49 24-Jan-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] mpc5200: normalize compatible property bindings

Update MPC5200 drivers to also look for compatible properties in the
form "fsl,mpc5200-*" to better conform to open firmware generic names
recommended practice as published here:

http://www.openfirmware.org/1275/practice/gnames/gnamv14a.html

This patch should *not* break compatibility with older device trees
which do not use the 'fsl,' prefix. The drivers will still bind against
the older names also.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 75ca399e 18-Jan-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] mpc5200: eliminate mpc52xx_*_map_*() functions.

mpc5200 platform code defines a bunch of map functions which duplicate the
functionality of of_iomap(). Remove them and use of_iomap() instead.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# a6f024bb 09-Nov-2007 Marian Balakowicz <m8@semihalf.com>

[POWERPC] mpc5200: Add 'fsl,lpb' bus type for localplus bus

Define MPC52xx specific device id list, add new
'fsl,lpb' compatible id for LocalPlus Bus.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 86b92cdd 18-Oct-2007 Marian Balakowicz <m8@semihalf.com>

[POWERPC] Add restart support for mpc52xx based platforms

Add common helper routines: mpc52xx_map_wdt() and mpc52xx_restart().

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# c5c01c97 18-Oct-2007 Marian Balakowicz <m8@semihalf.com>

[POWERPC] Add mpc52xx_find_and_map_path(), refactor utility functions

Add helper routine mpc52xx_find_and_map_path(). Extract common code to
mpc52xx_map_node() and refactor mpc52xx_find_and_map().

Signed-off-by: Jan Wrobel <wrr@semihalf.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 4de3b992 09-Oct-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] MPC5200: Don't make firmware fixups into common code

The Lite5200 u-boot image doesn't entirely configure the processor
correctly and so Linux needs to fixup the cpu setup in setup_arch. Fixing
the CPU setup is good, but making it into common code is not a good idea.

New board ports should be encouraged not to take the lead of the lite5200
and instead get their firmware to setup the CPU the right way.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Sylvain Munaut <tnt@246tnt.com>


# 9fe2e796 10-Oct-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] MPC52xx: Trim includes on mpc5200 platform support code

Drop unnecessary includes for MPC5200 based boards

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Sylvain Munaut <tnt@246tnt.com>


# e2eb6392 03-Apr-2007 Stephen Rothwell <sfr@canb.auug.org.au>

[POWERPC] Rename get_property to of_get_property: arch/powerpc

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# e3aba81d 12-Feb-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Fixup mp5200 drivers to match device tree changes

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 5c334eed 02-Jan-2007 Sylvain Munaut <tnt@246tNt.com>

[POWERPC] 52xx: Don't use device_initcall to probe of_platform_bus

Using device_initcall makes it happen for every platform that
compiles this file in. This is really bad, for obvious reasons.

Instead, we use the .init field of the machine description. If
the platform needs the hook to do something specific it can provides
its own function and call mpc52xx_declare_of_platform_devices from
there. If not, the mpc52xx_declare_of_platform_devices function can
directly be used as the init hook.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# d8594d63 04-Dec-2006 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Add missing EXPORTS for mpc52xx support

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 6065170c 27-Nov-2006 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Add common routines for 52xx support in arch/powerpc

Adds utility routines used by 52xx device drivers and board support
code. Main functionality is to add device nodes to the of_platform_bus,
retrieve the IPB bus frequency, and find+ioremap device registers.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>