9
0
Fork 0
Commit Graph

46 Commits

Author SHA1 Message Date
Sascha Hauer 3aa17a1e18 PPC: FSL DDR: Fix compiler warning
Fixes:

arch/ppc/boards/freescale-p1022ds/ddr.c: In function 'fsl_ddr_board_info':
arch/ppc/boards/freescale-p1022ds/ddr.c:39:21: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-05 10:17:28 +02:00
Sascha Hauer 48f1fa806f ppc: io: Add _IO_BASE define
To make inb/outb and friends work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 08:31:06 +02:00
Renaud Barbier cbeded2bad ppc: mpc8xxx: add DDR3 support
Add DDR3 support into the MPC8xxx DDR driver.

To avoid confusion, the function set_ddr_sdram_mode is renamed
set_ddr2_sdram_mode.

Checking for errors is simplified in the DDR2 DIMM parameters
computation to be consistent with DDR3.

This code is derived from the files found in directory drivers/ddr/fsl
from U-Boot version git-be937b5.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-19 07:42:58 +01:00
Renaud Barbier df188547a9 ppc: add SoC support for Freescale P1022
CPU, DDR, and LBC definitions are added to support the Freescale P1022.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:29:06 +01:00
Renaud Barbier 8c2f0bb041 ppc: add support for memtest with cache disabled
Add support to enable caching on a memory region during the memory test.

Tested on P2020RDB and DA923RC.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 09:07:20 +01:00
Sascha Hauer ada75addee Merge branch 'for-next/ppc' 2014-02-03 09:55:55 +01:00
Renaud Barbier b99e853aff ppc: remove bit operation headers file conflict
Removed the ppc bit operation functions and definitions in the ppc
file asm/bitops.h since these are already defined in the asm-generic header
files. Moved ffs64 definition to the mpc85xx header files because
the function requires the inclusion of linux/log2.h which also includes
asm/bitops.h.

The conflict was noted when UBIFS was enabled in barebox.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-30 08:42:53 +01:00
Renaud Barbier b79f78997d ppc: cpu-85xx: import U-Boot start-up code
Import U-Boot start-up code from version git-9407c3fc to include the
latest CPUs errata and make future U-Boot code inclusion easier. The
code import is limited to the currently supported CPUs P2020/MPC8544.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-16 14:00:30 +01:00
Renaud Barbier 48b5b23286 ppc: cpu-85xx: upgrade MMU support to v2 pages sizes
TLB support for the 85xx CPUs has been upgraded to support the MMUv2
page size definitions. This has been imported from U-Boot version
git-9407c3fc. This allows for future CPUs to make use of the new MMU
support.

Also the definition of MAX_MEM_MAPPED has been changed to avoid type
casting with "min" macro.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-16 14:00:30 +01:00
Renaud Barbier 2e6750444e ppc: mpc85xx: mpc8544 support
Definitions are added to support the mpc8544 sOC.

The function returning the I2C bus frequency is updated
to take into account the mpc8544 specific clock ratio.
A mininal GPIO API is added to enable and set the GPIO
out pins.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 11:04:37 +01:00
Renaud Barbier 9d2745425e ppc: bootm: relocate fdt to valid boot memory
For the MPC85xx family of SOCs Linux expects any boot firmware
information to be passed in the first 64MiB of memory. This adds support
to ensure that the device tree is relocated to a valid location if it is
outside that address range.

For the other SOC family currently present in the ppc architecture, the
default is not to relocate as at Linux startup the virtual address
equals the physical address.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 17:08:39 +02:00
Renaud Barbier 99fbfdfc1b ppc: add and update device tree fixup functions
This adds support for populating derived properties of the mpc85xx SOC
which are not typically included in the dtb directly.

This update is based on U-Boot code from common/fdt_support.c
and arch/powerpc/cpu/mpc85xx/fdt.c - version git-2b26201.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 10:28:04 +02:00
Renaud Barbier 2fbd8f1ade mpc85xx: remove local bus initialisation
The early initialisation of chip select 0 (boot flash) is removed
from cpu initialisation. This removes the dependency on board
base address definition.

Consequently, cpu_init_f is not called in the start-up code but
added to the init call list as cpu_init_r. Also the file
arch/ppc/mach-mpc85xx/fsl_lbc.c is deleted.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-05 12:09:22 +02:00
Sascha Hauer 8afe2cb4d4 Merge branch 'for-next-manual/oftree-linux-sync' 2013-07-02 07:08:46 +02:00
Renaud Barbier d8341ecadc ppc asm: DDR headers
Definitions and structures have been added to record DIMM parameters
and configure memory options.

The code is based on the equivalent files in the directory
arch/powerpc/include/asm from U-boot version git-a71d45d.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-27 08:38:04 +02:00
Sascha Hauer c179e7c46b ppc: remove strcasecmp/strncasecmp prototypes
ppc does not implement these, so remove the prototypes and use
the ones from include/linux/string.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 17:17:28 +02:00
Renaud Barbier e0594d51a3 ppc: update I/O accessors
The I/O accessors in_bexx, out_bexx, in_lexx and out_lexx are updated
to the latest Linux version.

The patch is tested on a MPC8544 based board and solved I/O access
issues on I2C devices.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:52:17 +02:00
Renaud Barbier b73be000f3 ppc io.h: fix indentation
To prepare for an update of the I/O functions to the latest Linux
version, the indentation is fixed.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:52:17 +02:00
Alexander Aring 47326f80a9 remap_range: make function 'remap_range' global
Change function remap_range in arm architecture to make it
global accessable. For example command 'memtest' can change
pte flags to enable or disable cache.

Add dummy function for others architectures that doesn't
have mmu or pte support.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-18 08:28:20 +01:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Sascha Hauer 038307cb5e Merge branch 'for-next/i2c' 2012-09-05 12:59:29 +02:00
Renaud Barbier 0f9ca850a5 ppc: add unaligned support
This file is copied from Linux 2.6.39. It is added so that the P2020RDB
can still build.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-04 08:55:29 +02:00
Renaud Barbier 705d7fa2b4 ppc/asm/fsl_i2c.h is removed
The i2c-imx driver is able to support the I2C bus on the 85xx machines
with minor modifications. It already defines register offsets. Therefore,
this header file is no longer needed.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:34:25 +02:00
Marc Kleine-Budde ed2180d658 blackfin, mips, openrisc, ppc, sandbox, x86: add generic dma_alloc, dma_free inlines
Some drivers call dma_inv_range() on buffers, on arm these buffers must
be cache line aligned. This patch introduces a generic dma_alloc,
dma_free. Archs can implement in their own functions in "asm/dma.h" and add a:

	#define dma_alloc dma_alloc
	#define dma_free dma_free

On all other archs the generic versions, which translate into xmalloc
and free are used.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Renaud Barbier ac28dd8620 Initial e500v2 start up code
This is the first part of the start-up code. The source code origin is
U-boot and is slightly modified to have e500v2 CPU support in 32-bit
mode only.
It includes the power-up entry point, CPU initialization code and
exports definition for D-cache flush and I-cache invalidate.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-17 20:33:38 +02:00
Renaud Barbier 16e2a4295d Initial Freescale 85xx Headers.
These header files are added to provide a minimal support to the
Freescale 85xx cpu to boot on a P2020RDB platform.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-17 20:33:38 +02:00
Renaud Barbier f755d703c4 ppc io.h: update following MMIO primitives fix
Following the MMIO primitives fix, the definitions of __raw_* function
is sourced from Linux and added.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-11 09:06:44 +02:00
Renaud Barbier bd20ba6798 Preparation stage to support multiple PPC architectures
arch/ppc/Kconfig is reworked to make the configuration environment
architecture neutral. All MPC5200 configuration is moved to the
MPC5200 architecture specific configuration file. These modifications
are reflected in the PCM030 board support.

arch/ppc/Makefile compilation directives are updated in preparation
for the introduction of future cpus/machines.

lib/time.c is moved to the architecture specific directory and the
building instructions updated in the Make files. The file is
cleaned up of unused code.

The definition of L1_CACHE_... is updated and CACHELINE_SIZE is
defined in ppc/include/asm/cache.h for future use by the mpc85xx.
The file mach-mpc5xxx/pci_mpc5200.c and mach-mpc5xxx/start.S are
updated accordingly.

The declaration of search_exception_table is moved in
include/asm/common.h because it is used across architectures.
mach-mpc5xxx/traps.c is also updated to reflect this change.

The definition of exception in asm/ppc_asm.tmpl is updated for future
use by the mpc85xx. The file starts.S in mach-mpc5xxx is updated
accordingly.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:16:30 +02:00
Sascha Hauer 84aec66a83 ppc mmu.h: update for future mpc85xx support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:16:04 +02:00
Sascha Hauer 9527058c81 ppc processor.h: Update for future mpc85xx support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:12:57 +02:00
Sascha Hauer 608a9633e4 ppc: add clr/setbits operations
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:09:49 +02:00
Sascha Hauer 272704fcf3 ppc: Add fls, fls64, __ilog2_u64 and ffs64 bitops
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:09:22 +02:00
Sascha Hauer 81568b32c3 ppc: remove unused bd_t
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-13 23:38:22 +02:00
Sascha Hauer a9c5b19b70 ppc: remove unused init_board_data function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-13 23:36:50 +02:00
Sascha Hauer 0e811d11a6 ppc common.h: remove unused function declarations
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 11:54:11 +02:00
Sascha Hauer d01070c8af remove EARLY_INIT and EARLY_CONSOLE support
Bitrotted over time and nearly unused, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 10:27:18 +02:00
Sascha Hauer bbbfb9f4f8 ppc: add a get_pc() function
Useful to determine whether sdram has to be setup or not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 09:44:54 +02:00
Sascha Hauer 3ee7877a48 introduce io.h
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:03:05 +02:00
Sascha Hauer 147affbd8d remove unused global_data.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 12:00:59 +02:00
Sascha Hauer 92c1c6cfb1 add sections.h header file
The file location and variable names from the Linux Kernel have been
used here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 11:04:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD be4146161b import swab.h arch implementation form linux v2.3.37
this will avoid __bswapsi2 issue see with gcc 4.5.1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 09:39:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5156e781bd import __stringify from linux
update the current code

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-29 09:30:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD 55819d58d4 types.h: move __kernel_dev_t to include/linux/types.h
no need to have a arch specific type

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Sascha Hauer c73c32b72d ppc bitops: Fix compiler warning
Our version of ppc bitops produces the following compiler warnings:

/ptx/work/octopus/WORK_1/sha/u-boot/barebox/arch/ppc/include/asm/bitops.h:
In function 'ext2_find_next_zero_bit':
/ptx/work/octopus/WORK_1/sha/u-boot/barebox/arch/ppc/include/asm/bitops.h:294:
warning: '__swab32p' is static but used in inline function 'ext2_find_next_zero_bit' which is not static

Looking at the kernel ext2_find_next_zero_bit is defined as
generic_find_next_zero_le_bit which is in generic kernel code.

We currently do not need this, so do the very same define to silence the
compiler. If somebody ever needs this function, the resulting error
should give him a hint what to do.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-17 13:30:22 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Jean-Christophe PLAGNIOL-VILLARD abd9cd4945 [PPC] move include/asm-ppc to arch/ppc/include/asm
Move platform independent header files to arch/ppc/include/asm, leaving
those in asm/arch*.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 14:21:29 +02:00