Commit 15a4cb9c authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc

* master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (194 commits)
  [POWERPC] Add missing EXPORTS for mpc52xx support
  [POWERPC] Remove obsolete PPC_52xx and update CLASSIC32 comment
  [POWERPC] ps3: add a default zImage target
  [POWERPC] Add of_platform_bus support to mpc52xx psc uart driver
  [POWERPC] typo fix and whitespace cleanup on mpc52xx-uart driver
  [POWERPC] Fix debug printks for 32-bit resources in the PCI code
  [POWERPC] Replace kmalloc+memset with kzalloc
  [POWERPC] Linkstation / kurobox support
  [POWERPC] Add the e300c3 core to the CPU table.
  [POWERPC] ppc: m48t35 add missing bracket
  [POWERPC] iSeries: don't build head_64.o unnecessarily
  [POWERPC] iSeries: stop dt_mod.o being rebuilt unnecessarily
  [POWERPC] Fix cputable.h for combined build
  [POWERPC] Allow CONFIG_BOOTX_TEXT on iSeries
  [POWERPC] Allow xmon to build on legacy iSeries
  [POWERPC] Change ppc64_defconfig to use AUTOFS_V4 not V3
  [POWERPC] Tell firmware we can handle POWER6 compatible mode
  [POWERPC] Clean images in arch/powerpc/boot
  [POWERPC] Fix OF pci flags parsing
  [POWERPC] defconfig for lite5200 board
  ...
parents ff51a987 d8594d63
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
IBM Corp. IBM Corp.
(c) 2005 Becky Bruce <becky.bruce at freescale.com>, (c) 2005 Becky Bruce <becky.bruce at freescale.com>,
Freescale Semiconductor, FSL SOC and 32-bit additions Freescale Semiconductor, FSL SOC and 32-bit additions
(c) 2006 MontaVista Software, Inc.
Flash chip node definition
May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet. May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet.
...@@ -1693,6 +1695,43 @@ platforms are moved over to use the flattened-device-tree model. ...@@ -1693,6 +1695,43 @@ platforms are moved over to use the flattened-device-tree model.
}; };
}; };
g) Flash chip nodes
Flash chips (Memory Technology Devices) are often used for solid state
file systems on embedded devices.
Required properties:
- device_type : has to be "rom"
- compatible : Should specify what this ROM device is compatible with
(i.e. "onenand"). Currently, this is most likely to be "direct-mapped"
(which corresponds to the MTD physmap mapping driver).
- regs : Offset and length of the register set (or memory mapping) for
the device.
Recommended properties :
- bank-width : Width of the flash data bus in bytes. Required
for the NOR flashes (compatible == "direct-mapped" and others) ONLY.
- partitions : Several pairs of 32-bit values where the first value is
partition's offset from the start of the device and the second one is
partition size in bytes with LSB used to signify a read only
partititon (so, the parition size should always be an even number).
- partition-names : The list of concatenated zero terminated strings
representing the partition names.
Example:
flash@ff000000 {
device_type = "rom";
compatible = "direct-mapped";
regs = <ff000000 01000000>;
bank-width = <4>;
partitions = <00000000 00f80000
00f80000 00080001>;
partition-names = "fs\0firmware";
};
More devices will be defined as this spec matures. More devices will be defined as this spec matures.
......
MPC52xx Device Tree Bindings
----------------------------
(c) 2006 Secret Lab Technologies Ltd
Grant Likely <grant.likely at secretlab.ca>
I - Introduction
================
Boards supported by the arch/powerpc architecture require device tree be
passed by the boot loader to the kernel at boot time. The device tree
describes what devices are present on the board and how they are
connected. The device tree can either be passed as a binary blob (as
described in Documentation/powerpc/booting-without-of.txt), or passed
by Open Firmare (IEEE 1275) compatible firmware using an OF compatible
client interface API.
This document specifies the requirements on the device-tree for mpc52xx
based boards. These requirements are above and beyond the details
specified in either the OpenFirmware spec or booting-without-of.txt
All new mpc52xx-based boards are expected to match this document. In
cases where this document is not sufficient to support a new board port,
this document should be updated as part of adding the new board support.
II - Philosophy
===============
The core of this document is naming convention. The whole point of
defining this convention is to reduce or eliminate the number of
special cases required to support a 52xx board. If all 52xx boards
follow the same convention, then generic 52xx support code will work
rather than coding special cases for each new board.
This section tries to capture the thought process behind why the naming
convention is what it is.
1. Node names
-------------
There is strong convention/requirements already established for children
of the root node. 'cpus' describes the processor cores, 'memory'
describes memory, and 'chosen' provides boot configuration. Other nodes
are added to describe devices attached to the processor local bus.
Following convention already established with other system-on-chip
processors, MPC52xx boards must have an 'soc5200' node as a child of the
root node.
The soc5200 node holds child nodes for all on chip devices. Child nodes
are typically named after the configured function. ie. the FEC node is
named 'ethernet', and a PSC in uart mode is named 'serial'.
2. device_type property
-----------------------
similar to the node name convention above; the device_type reflects the
configured function of a device. ie. 'serial' for a uart and 'spi' for
an spi controller. However, while node names *should* reflect the
configured function, device_type *must* match the configured function
exactly.
3. compatible property
----------------------
Since device_type isn't enough to match devices to drivers, there also
needs to be a naming convention for the compatible property. Compatible
is an list of device descriptions sorted from specific to generic. For
the mpc52xx, the required format for each compatible value is
<chip>-<device>[-<mode>]. At the minimum, the list shall contain two
items; the first specifying the exact chip, and the second specifying
mpc52xx for the chip.
ie. ethernet on mpc5200b: compatible = "mpc5200b-ethernet\0mpc52xx-ethernet"
The idea here is that most drivers will match to the most generic field
in the compatible list (mpc52xx-*), but can also test the more specific
field for enabling bug fixes or extra features.
Modal devices, like PSCs, also append the configured function to the
end of the compatible field. ie. A PSC in i2s mode would specify
"mpc52xx-psc-i2s", not "mpc52xx-i2s". This convention is chosen to
avoid naming conflicts with non-psc devices providing the same
function. For example, "mpc52xx-spi" and "mpc52xx-psc-spi" describe
the mpc5200 simple spi device and a PSC spi mode respectively.
If the soc device is more generic and present on other SOCs, the
compatible property can specify the more generic device type also.
ie. mscan: compatible = "mpc5200-mscan\0mpc52xx-mscan\0fsl,mscan";
At the time of writing, exact chip may be either 'mpc5200' or
'mpc5200b'.
Device drivers should always try to match as generically as possible.
III - Structure
===============
The device tree for an mpc52xx board follows the structure defined in
booting-without-of.txt with the following additional notes:
0) the root node
----------------
Typical root description node; see booting-without-of
1) The cpus node
----------------
The cpus node follows the basic layout described in booting-without-of.
The bus-frequency property holds the XLB bus frequency
The clock-frequency property holds the core frequency
2) The memory node
------------------
Typical memory description node; see booting-without-of.
3) The soc5200 node
-------------------
This node describes the on chip SOC peripherals. Every mpc52xx based
board will have this node, and as such there is a common naming
convention for SOC devices.
Required properties:
name type description
---- ---- -----------
device_type string must be "soc"
ranges int should be <0 baseaddr baseaddr+10000>
reg int must be <baseaddr 10000>
Recommended properties:
name type description
---- ---- -----------
compatible string should be "<chip>-soc\0mpc52xx-soc"
ie. "mpc5200b-soc\0mpc52xx-soc"
#interrupt-cells int must be <3>. If it is not defined
here then it must be defined in every
soc device node.
bus-frequency int IPB bus frequency in HZ. Clock rate
used by most of the soc devices.
Defining it here avoids needing it
added to every device node.
4) soc5200 child nodes
----------------------
Any on chip SOC devices available to Linux must appear as soc5200 child nodes.
Note: in the tables below, '*' matches all <chip> values. ie.
*-pic would translate to "mpc5200-pic\0mpc52xx-pic"
Required soc5200 child nodes:
name device_type compatible Description
---- ----------- ---------- -----------
cdm@<addr> cdm *-cmd Clock Distribution
pic@<addr> interrupt-controller *-pic need an interrupt
controller to boot
bestcomm@<addr> dma-controller *-bestcomm 52xx pic also requires
the bestcomm device
Recommended soc5200 child nodes; populate as needed for your board
name device_type compatible Description
---- ----------- ---------- -----------
gpt@<addr> gpt *-gpt General purpose timers
rtc@<addr> rtc *-rtc Real time clock
mscan@<addr> mscan *-mscan CAN bus controller
pci@<addr> pci *-pci PCI bridge
serial@<addr> serial *-psc-uart PSC in serial mode
i2s@<addr> i2s *-psc-i2s PSC in i2s mode
ac97@<addr> ac97 *-psc-ac97 PSC in ac97 mode
spi@<addr> spi *-psc-spi PSC in spi mode
irda@<addr> irda *-psc-irda PSC in IrDA mode
spi@<addr> spi *-spi MPC52xx spi device
ethernet@<addr> network *-fec MPC52xx ethernet device
ata@<addr> ata *-ata IDE ATA interface
i2c@<addr> i2c *-i2c I2C controller
usb@<addr> usb-ohci-be *-ohci,ohci-be USB controller
xlb@<addr> xlb *-xlb XLB arbritrator
IV - Extra Notes
================
1. Interrupt mapping
--------------------
The mpc52xx pic driver splits hardware IRQ numbers into two levels. The
split reflects the layout of the PIC hardware itself, which groups
interrupts into one of three groups; CRIT, MAIN or PERP. Also, the
Bestcomm dma engine has it's own set of interrupt sources which are
cascaded off of peripheral interrupt 0, which the driver interprets as a
fourth group, SDMA.
The interrupts property for device nodes using the mpc52xx pic consists
of three cells; <L1 L2 level>
L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
L2 := interrupt number; directly mapped from the value in the
"ICTL PerStat, MainStat, CritStat Encoded Register"
level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]
...@@ -2438,6 +2438,13 @@ M: promise@pnd-pc.demon.co.uk ...@@ -2438,6 +2438,13 @@ M: promise@pnd-pc.demon.co.uk
W: http://www.pnd-pc.demon.co.uk/promise/ W: http://www.pnd-pc.demon.co.uk/promise/
S: Maintained S: Maintained
PS3 PLATFORM SUPPORT
P: Geoff Levand
M: geoffrey.levand@am.sony.com
L: linuxppc-dev@ozlabs.org
L: cbe-oss-dev@ozlabs.org
S: Supported
PVRUSB2 VIDEO4LINUX DRIVER PVRUSB2 VIDEO4LINUX DRIVER
P: Mike Isely P: Mike Isely
M: isely@pobox.com M: isely@pobox.com
......
...@@ -112,7 +112,7 @@ choice ...@@ -112,7 +112,7 @@ choice
default 6xx default 6xx
config CLASSIC32 config CLASSIC32
bool "6xx/7xx/74xx" bool "52xx/6xx/7xx/74xx"
select PPC_FPU select PPC_FPU
select 6xx select 6xx
help help
...@@ -121,16 +121,18 @@ config CLASSIC32 ...@@ -121,16 +121,18 @@ config CLASSIC32
versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC
embedded versions (403 and 405) and the high end 64 bit Power embedded versions (403 and 405) and the high end 64 bit Power
processors (POWER 3, POWER4, and IBM PPC970 also known as G5). processors (POWER 3, POWER4, and IBM PPC970 also known as G5).
This option is the catch-all for 6xx types, including some of the
embedded versions. Unless there is see an option for the specific
chip family you are using, you want this option.
You do not want this if you are building a kernel for a 64 bit
IBM RS/6000 or an Apple G5, choose 6xx.
If unsure, select this option
Unless you are building a kernel for one of the embedded processor
systems, 64 bit IBM RS/6000 or an Apple G5, choose 6xx.
Note that the kernel runs in 32-bit mode even on 64-bit chips. Note that the kernel runs in 32-bit mode even on 64-bit chips.
config PPC_52xx
bool "Freescale 52xx"
select 6xx
select PPC_FPU
config PPC_82xx config PPC_82xx
bool "Freescale 82xx" bool "Freescale 82xx"
select 6xx select 6xx
...@@ -160,9 +162,11 @@ config PPC_86xx ...@@ -160,9 +162,11 @@ config PPC_86xx
config 40x config 40x
bool "AMCC 40x" bool "AMCC 40x"
select PPC_DCR_NATIVE
config 44x config 44x
bool "AMCC 44x" bool "AMCC 44x"
select PPC_DCR_NATIVE
config 8xx config 8xx
bool "Freescale 8xx" bool "Freescale 8xx"
...@@ -208,6 +212,24 @@ config PPC_FPU ...@@ -208,6 +212,24 @@ config PPC_FPU
bool bool
default y if PPC64 default y if PPC64
config PPC_DCR_NATIVE
bool
default n
config PPC_DCR_MMIO
bool
default n
config PPC_DCR
bool
depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
default y
config PPC_OF_PLATFORM_PCI
bool
depends on PPC64 # not supported on 32 bits yet
default n
config BOOKE config BOOKE
bool bool
depends on E200 || E500 depends on E200 || E500
...@@ -227,6 +249,7 @@ config PTE_64BIT ...@@ -227,6 +249,7 @@ config PTE_64BIT
config PHYS_64BIT config PHYS_64BIT
bool 'Large physical address support' if E500 bool 'Large physical address support' if E500
depends on 44x || E500 depends on 44x || E500
select RESOURCES_64BIT
default y if 44x default y if 44x
---help--- ---help---
This option enables kernel support for larger than 32-bit physical This option enables kernel support for larger than 32-bit physical
...@@ -369,11 +392,13 @@ config PPC_PSERIES ...@@ -369,11 +392,13 @@ config PPC_PSERIES
select PPC_RTAS select PPC_RTAS
select RTAS_ERROR_LOGGING select RTAS_ERROR_LOGGING
select PPC_UDBG_16550 select PPC_UDBG_16550
select PPC_NATIVE
default y default y
config PPC_ISERIES config PPC_ISERIES
bool "IBM Legacy iSeries" bool "IBM Legacy iSeries"
depends on PPC_MULTIPLATFORM && PPC64 depends on PPC_MULTIPLATFORM && PPC64
select PPC_INDIRECT_IO
config PPC_CHRP config PPC_CHRP
bool "Common Hardware Reference Platform (CHRP) based machines" bool "Common Hardware Reference Platform (CHRP) based machines"
...@@ -384,14 +409,35 @@ config PPC_CHRP ...@@ -384,14 +409,35 @@ config PPC_CHRP
select PPC_RTAS select PPC_RTAS
select PPC_MPC106 select PPC_MPC106
select PPC_UDBG_16550 select PPC_UDBG_16550
select PPC_NATIVE
default y
config PPC_MPC52xx
bool
default n
config PPC_EFIKA
bool "bPlan Efika 5k2. MPC5200B based computer"
depends on PPC_MULTIPLATFORM && PPC32
select PPC_RTAS
select RTAS_PROC
select PPC_MPC52xx
select PPC_NATIVE
default y default y
config PPC_LITE5200
bool "Freescale Lite5200 Eval Board"
depends on PPC_MULTIPLATFORM && PPC32
select PPC_MPC52xx
default n
config PPC_PMAC config PPC_PMAC
bool "Apple PowerMac based machines" bool "Apple PowerMac based machines"
depends on PPC_MULTIPLATFORM depends on PPC_MULTIPLATFORM
select MPIC select MPIC
select PPC_INDIRECT_PCI if PPC32 select PPC_INDIRECT_PCI if PPC32
select PPC_MPC106 if PPC32 select PPC_MPC106 if PPC32
select PPC_NATIVE
default y default y
config PPC_PMAC64 config PPC_PMAC64
...@@ -411,6 +457,7 @@ config PPC_PREP ...@@ -411,6 +457,7 @@ config PPC_PREP
select PPC_I8259 select PPC_I8259
select PPC_INDIRECT_PCI select PPC_INDIRECT_PCI
select PPC_UDBG_16550 select PPC_UDBG_16550
select PPC_NATIVE
default y default y
config PPC_MAPLE config PPC_MAPLE
...@@ -422,6 +469,7 @@ config PPC_MAPLE ...@@ -422,6 +469,7 @@ config PPC_MAPLE
select GENERIC_TBSYNC select GENERIC_TBSYNC
select PPC_UDBG_16550 select PPC_UDBG_16550
select PPC_970_NAP select PPC_970_NAP
select PPC_NATIVE
default n default n
help help
This option enables support for the Maple 970FX Evaluation Board. This option enables support for the Maple 970FX Evaluation Board.
...@@ -434,6 +482,7 @@ config PPC_PASEMI ...@@ -434,6 +482,7 @@ config PPC_PASEMI
select MPIC select MPIC
select PPC_UDBG_16550 select PPC_UDBG_16550
select GENERIC_TBSYNC select GENERIC_TBSYNC
select PPC_NATIVE
help help
This option enables support for PA Semi's PWRficient line This option enables support for PA Semi's PWRficient line
of SoC processors, including PA6T-1682M of SoC processors, including PA6T-1682M
...@@ -445,6 +494,11 @@ config PPC_CELL ...@@ -445,6 +494,11 @@ config PPC_CELL
config PPC_CELL_NATIVE config PPC_CELL_NATIVE
bool bool
select PPC_CELL select PPC_CELL
select PPC_DCR_MMIO
select PPC_OF_PLATFORM_PCI
select PPC_INDIRECT_IO
select PPC_NATIVE
select MPIC
default n default n
config PPC_IBM_CELL_BLADE config PPC_IBM_CELL_BLADE
...@@ -456,6 +510,22 @@ config PPC_IBM_CELL_BLADE ...@@ -456,6 +510,22 @@ config PPC_IBM_CELL_BLADE
select PPC_UDBG_16550 select PPC_UDBG_16550
select UDBG_RTAS_CONSOLE select UDBG_RTAS_CONSOLE
config PPC_PS3
bool "Sony PS3"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL
help
This option enables support for the Sony PS3 game console
and other platforms using the PS3 hypervisor.
config PPC_NATIVE
bool
depends on PPC_MULTIPLATFORM
help
Support for running natively on the hardware, i.e. without
a hypervisor. This option is not user-selectable but should
be selected by all platforms that need it.
config UDBG_RTAS_CONSOLE config UDBG_RTAS_CONSOLE
bool "RTAS based debug console" bool "RTAS based debug console"
depends on PPC_RTAS depends on PPC_RTAS
...@@ -517,6 +587,15 @@ config PPC_970_NAP ...@@ -517,6 +587,15 @@ config PPC_970_NAP
bool bool
default n default n
config PPC_INDIRECT_IO
bool
select GENERIC_IOMAP
default n
config GENERIC_IOMAP
bool
default n
source "drivers/cpufreq/Kconfig" source "drivers/cpufreq/Kconfig"
config CPU_FREQ_PMAC config CPU_FREQ_PMAC
...@@ -594,12 +673,6 @@ config TAU_AVERAGE ...@@ -594,12 +673,6 @@ config TAU_AVERAGE
If in doubt, say N here. If in doubt, say N here.
config PPC_TODC
depends on EMBEDDED6xx
bool "Generic Time-of-day Clock (TODC) support"
---help---
This adds support for many TODC/RTC chips.
endmenu endmenu
source arch/powerpc/platforms/embedded6xx/Kconfig source arch/powerpc/platforms/embedded6xx/Kconfig
...@@ -610,6 +683,7 @@ source arch/powerpc/platforms/85xx/Kconfig ...@@ -610,6 +683,7 @@ source arch/powerpc/platforms/85xx/Kconfig
source arch/powerpc/platforms/86xx/Kconfig source arch/powerpc/platforms/86xx/Kconfig
source arch/powerpc/platforms/8xx/Kconfig source arch/powerpc/platforms/8xx/Kconfig
source arch/powerpc/platforms/cell/Kconfig source arch/powerpc/platforms/cell/Kconfig
source arch/powerpc/platforms/ps3/Kconfig
menu "Kernel options" menu "Kernel options"
...@@ -790,7 +864,6 @@ source "arch/powerpc/platforms/prep/Kconfig" ...@@ -790,7 +864,6 @@ source "arch/powerpc/platforms/prep/Kconfig"
config CMDLINE_BOOL config CMDLINE_BOOL
bool "Default bootloader kernel arguments" bool "Default bootloader kernel arguments"
depends on !PPC_ISERIES
config CMDLINE config CMDLINE
string "Initial kernel command string" string "Initial kernel command string"
...@@ -880,7 +953,7 @@ config MCA ...@@ -880,7 +953,7 @@ config MCA
config PCI config PCI
bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \ bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
|| PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) || MPC7448HPC2 || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) || MPC7448HPC2 || PPC_PS3
default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \ default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
&& !PPC_85xx && !PPC_86xx && !PPC_85xx && !PPC_86xx
default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
......
...@@ -77,7 +77,7 @@ config KGDB_CONSOLE ...@@ -77,7 +77,7 @@ config KGDB_CONSOLE
config XMON config XMON
bool "Include xmon kernel debugger" bool "Include xmon kernel debugger"
depends on DEBUGGER && !PPC_ISERIES depends on DEBUGGER
help help
Include in-kernel hooks for the xmon kernel monitor/debugger. Include in-kernel hooks for the xmon kernel monitor/debugger.
Unless you are intending to debug the kernel, say N here. Unless you are intending to debug the kernel, say N here.
...@@ -98,6 +98,15 @@ config XMON_DEFAULT ...@@ -98,6 +98,15 @@ config XMON_DEFAULT
xmon is normally disabled unless booted with 'xmon=on'. xmon is normally disabled unless booted with 'xmon=on'.
Use 'xmon=off' to disable xmon init during runtime. Use 'xmon=off' to disable xmon init during runtime.
config XMON_DISASSEMBLY
bool "Include disassembly support in xmon"
depends on XMON
default y
help
Include support for disassembling in xmon. You probably want
to say Y here, unless you're building for a memory-constrained
system.
config IRQSTACKS config IRQSTACKS
bool "Use separate kernel stacks when processing interrupts" bool "Use separate kernel stacks when processing interrupts"
depends on PPC64 depends on PPC64
...@@ -116,7 +125,7 @@ config BDI_SWITCH ...@@ -116,7 +125,7 @@ config BDI_SWITCH
config BOOTX_TEXT config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)" bool "Support for early boot text console (BootX or OpenFirmware only)"
depends PPC_OF && !PPC_ISERIES depends PPC_OF
help help
Say Y here to see progress messages from the boot firmware in text Say Y here to see progress messages from the boot firmware in text
mode. Requires either BootX or Open Firmware. mode. Requires either BootX or Open Firmware.
......
addnote addnote
empty.c
hack-coff
infblock.c infblock.c
infblock.h infblock.h
infcodes.c infcodes.c
infcodes.h infcodes.h
inffast.c inffast.c
inffast.h inffast.h
inffixed.h
inflate.c inflate.c
inflate.h
inftrees.c inftrees.c
inftrees.h inftrees.h
infutil.c infutil.c
infutil.h infutil.h
kernel-vmlinux.strip.c kernel-vmlinux.strip.c
kernel-vmlinux.strip.gz kernel-vmlinux.strip.gz
mktree
uImage uImage
zImage zImage
zImage.chrp
zImage.coff
zImage.coff.lds
zImage.lds
zImage.miboot
zImage.pmac
zImage.pseries
zImage.sandpoint
zImage.vmode zImage.vmode
zconf.h zconf.h
zlib.h zlib.h
......
...@@ -40,7 +40,8 @@ zliblinuxheader := zlib.h zconf.h zutil.h ...@@ -40,7 +40,8 @@ zliblinuxheader := zlib.h zconf.h zutil.h
$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \ $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \
$(addprefix $(obj)/,$(zlibheader)) $(addprefix $(obj)/,$(zlibheader))
src-wlib := string.S stdio.c main.c div64.S $(zlib) src-wlib := string.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
ns16550.c serial.c simple_alloc.c div64.S util.S $(zlib)
src-plat := of.c src-plat := of.c
src-boot := crt0.S $(src-wlib) $(src-plat) empty.c src-boot := crt0.S $(src-wlib) $(src-plat) empty.c
...@@ -74,7 +75,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S ...@@ -74,7 +75,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S
@cp $< $@ @cp $< $@
clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \ clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
$(obj)/empty.c empty.c zImage zImage.coff.lds zImage.lds zImage.sandpoint
quiet_cmd_bootcc = BOOTCC $@ quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
...@@ -93,13 +94,13 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S ...@@ -93,13 +94,13 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
$(obj)/wrapper.a: $(obj-wlib) $(obj)/wrapper.a: $(obj-wlib)
$(call cmd,bootar) $(call cmd,bootar)
hostprogs-y := addnote addRamDisk hack-coff hostprogs-y := addnote addRamDisk hack-coff mktree
extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
$(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.lds $(obj)/zImage.coff.lds
wrapper :=$(srctree)/$(src)/wrapper wrapper :=$(srctree)/$(src)/wrapper
wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff) wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree)
############# #############
# Bits for building various flavours of zImage # Bits for building various flavours of zImage
...@@ -148,13 +149,18 @@ $(obj)/zImage.miboot: vmlinux $(wrapperbits) ...@@ -148,13 +149,18 @@ $(obj)/zImage.miboot: vmlinux $(wrapperbits)
$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits) $(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,miboot) $(call cmd,wrap_initrd,miboot)
$(obj)/zImage.ps3: vmlinux
$(STRIP) -s -R .comment $< -o $@
$(obj)/uImage: vmlinux $(wrapperbits) $(obj)/uImage: vmlinux $(wrapperbits)
$(call cmd,wrap,uboot) $(call cmd,wrap,uboot)
image-$(CONFIG_PPC_PSERIES) += zImage.pseries image-$(CONFIG_PPC_PSERIES) += zImage.pseries
image-$(CONFIG_PPC_MAPLE) += zImage.pseries image-$(CONFIG_PPC_MAPLE) += zImage.pseries
image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries
image-$(CONFIG_PPC_PS3) += zImage.ps3
image-$(CONFIG_PPC_CHRP) += zImage.chrp image-$(CONFIG_PPC_CHRP) += zImage.chrp
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
image-$(CONFIG_PPC_PMAC) += zImage.pmac image-$(CONFIG_PPC_PMAC) += zImage.pmac
image-$(CONFIG_DEFAULT_UIMAGE) += uImage image-$(CONFIG_DEFAULT_UIMAGE) += uImage
...@@ -176,3 +182,4 @@ install: $(CONFIGURE) $(image-y) ...@@ -176,3 +182,4 @@ install: $(CONFIGURE) $(image-y)
clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz) clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz)
clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.bin.gz) clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.bin.gz)
clean-files += $(image-)
/*
* Device Tree Souce for Buffalo KuroboxHG
*
* Choose CONFIG_LINKSTATION to build a kernel for KuroboxHG, or use
* the default configuration linkstation_defconfig.
*
* Based on sandpoint.dts
*
* 2006 (c) G. Liakhovetski <g.liakhovetski@gmx.de>
*
* This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
XXXX add flash parts, rtc, ??
build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
*/
/ {
linux,phandle = <1000>;
model = "KuroboxHG";
compatible = "linkstation";
#address-cells = <1>;
#size-cells = <1>;
cpus {
linux,phandle = <2000>;
#cpus = <1>;
#address-cells = <1>;
#size-cells = <0>;
PowerPC,603e { /* Really 8241 */
linux,phandle = <2100>;
linux,boot-cpu;
device_type = "cpu";
reg = <0>;
clock-frequency = <fdad680>; /* Fixed by bootwrapper */
timebase-frequency = <1F04000>; /* Fixed by bootwrapper */
bus-frequency = <0>; /* From bootloader */
/* Following required by dtc but not used */
i-cache-line-size = <0>;
d-cache-line-size = <0>;
i-cache-size = <4000>;
d-cache-size = <4000>;
};
};
memory {
linux,phandle = <3000>;
device_type = "memory";
reg = <00000000 08000000>;
};
soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
linux,phandle = <4000>;
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <2>;
device_type = "soc";
compatible = "mpc10x";
store-gathering = <0>; /* 0 == off, !0 == on */
reg = <80000000 00100000>;
ranges = <80000000 80000000 70000000 /* pci mem space */
fc000000 fc000000 00100000 /* EUMB */
fe000000 fe000000 00c00000 /* pci i/o space */
fec00000 fec00000 00300000 /* pci cfg regs */
fef00000 fef00000 00100000>; /* pci iack */
i2c@80003000 {
linux,phandle = <4300>;
device_type = "i2c";
compatible = "fsl-i2c";
reg = <80003000 1000>;
interrupts = <5 2>;
interrupt-parent = <4400>;
};
serial@80004500 {
linux,phandle = <4511>;
device_type = "serial";
compatible = "ns16550";
reg = <80004500 8>;
clock-frequency = <7c044a8>;
current-speed = <2580>;
interrupts = <9 2>;
interrupt-parent = <4400>;
};
serial@80004600 {
linux,phandle = <4512>;
device_type = "serial";
compatible = "ns16550";
reg = <80004600 8>;
clock-frequency = <7c044a8>;
current-speed = <e100>;
interrupts = <a 0>;
interrupt-parent = <4400>;
};
pic@80040000 {
linux,phandle = <4400>;
#interrupt-cells = <2>;
#address-cells = <0>;
device_type = "open-pic";
compatible = "chrp,open-pic";
interrupt-controller;
reg = <80040000 40000>;
built-in;
};
pci@fec00000 {
linux,phandle = <4500>;
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
device_type = "pci";
compatible = "mpc10x-pci";
reg = <fec00000 400000>;
ranges = <01000000 0 0 fe000000 0 00c00000
02000000 0 80000000 80000000 0 70000000>;
bus-range = <0 ff>;
clock-frequency = <7f28155>;
interrupt-parent = <4400>;
interrupt-map-mask = <f800 0 0 7>;
interrupt-map = <
/* IDSEL 0x11 - IRQ0 ETH */
5800 0 0 1 4400 0 1
5800 0 0 2 4400 1 1
5800 0 0 3 4400 2 1
5800 0 0 4 4400 3 1
/* IDSEL 0x12 - IRQ1 IDE0 */
6000 0 0 1 4400 1 1
6000 0 0 2 4400 2 1
6000 0 0 3 4400 3 1
6000 0 0 4 4400 0 1
/* IDSEL 0x14 - IRQ3 USB2.0 */
7000 0 0 1 4400 3 1
7000 0 0 2 4400 3 1
7000 0 0 3 4400 3 1
7000 0 0 4 4400 3 1
>;
};
};
};
/*
* Lite5200 board Device Tree Source
*
* Copyright 2006 Secret Lab Technologies Ltd.
* Grant Likely <grant.likely@secretlab.ca>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
/ {
model = "Lite5200";
compatible = "lite5200\0lite52xx\0mpc5200\0mpc52xx";
#address-cells = <1>;
#size-cells = <1>;
cpus {
#cpus = <1>;
#address-cells = <1>;
#size-cells = <0>;
PowerPC,5200@0 {
device_type = "cpu";
reg = <0>;
d-cache-line-size = <20>;
i-cache-line-size = <20>;
d-cache-size = <4000>; // L1, 16K
i-cache-size = <4000>; // L1, 16K
timebase-frequency = <0>; // from bootloader
bus-frequency = <0>; // from bootloader
clock-frequency = <0>; // from bootloader
32-bit;
};
};
memory {
device_type = "memory";
reg = <00000000 04000000>; // 64MB
};
soc5200@f0000000 {
#interrupt-cells = <3>;
device_type = "soc";
ranges = <0 f0000000 f0010000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
cdm@200 {
compatible = "mpc5200-cdm\0mpc52xx-cdm";
reg = <200 38>;
};
pic@500 {
// 5200 interrupts are encoded into two levels;
linux,phandle = <500>;
interrupt-controller;
#interrupt-cells = <3>;
device_type = "interrupt-controller";
compatible = "mpc5200-pic\0mpc52xx-pic";
reg = <500 80>;
built-in;
};
gpt@600 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <600 10>;
interrupts = <1 9 0>;
interrupt-parent = <500>;
};
gpt@610 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <610 10>;
interrupts = <1 a 0>;
interrupt-parent = <500>;
};
gpt@620 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <620 10>;
interrupts = <1 b 0>;
interrupt-parent = <500>;
};
gpt@630 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <630 10>;
interrupts = <1 c 0>;
interrupt-parent = <500>;
};
gpt@640 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <640 10>;
interrupts = <1 d 0>;
interrupt-parent = <500>;
};
gpt@650 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <650 10>;
interrupts = <1 e 0>;
interrupt-parent = <500>;
};
gpt@660 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <660 10>;
interrupts = <1 f 0>;
interrupt-parent = <500>;
};
gpt@670 { // General Purpose Timer
compatible = "mpc5200-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <670 10>;
interrupts = <1 10 0>;
interrupt-parent = <500>;
};
rtc@800 { // Real time clock
compatible = "mpc5200-rtc\0mpc52xx-rtc";
device_type = "rtc";
reg = <800 100>;
interrupts = <1 5 0 1 6 0>;
interrupt-parent = <500>;
};
mscan@900 {
device_type = "mscan";
compatible = "mpc5200-mscan\0mpc52xx-mscan";
interrupts = <2 11 0>;
interrupt-parent = <500>;
reg = <900 80>;
};
mscan@980 {
device_type = "mscan";
compatible = "mpc5200-mscan\0mpc52xx-mscan";
interrupts = <1 12 0>;
interrupt-parent = <500>;
reg = <980 80>;
};
gpio@b00 {
compatible = "mpc5200-gpio\0mpc52xx-gpio";
reg = <b00 40>;
interrupts = <1 7 0>;
interrupt-parent = <500>;
};
gpio-wkup@b00 {
compatible = "mpc5200-gpio-wkup\0mpc52xx-gpio-wkup";
reg = <c00 40>;
interrupts = <1 8 0 0 3 0>;
interrupt-parent = <500>;
};
pci@0d00 {
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
compatible = "mpc5200-pci\0mpc52xx-pci";
reg = <d00 100>;
interrupt-map-mask = <f800 0 0 7>;
interrupt-map = <c000 0 0 1 500 0 0 3
c000 0 0 2 500 0 0 3
c000 0 0 3 500 0 0 3
c000 0 0 4 500 0 0 3>;
clock-frequency = <0>; // From boot loader
interrupts = <2 8 0 2 9 0 2 a 0>;
interrupt-parent = <500>;
bus-range = <0 0>;
ranges = <42000000 0 80000000 80000000 0 20000000
02000000 0 a0000000 a0000000 0 10000000
01000000 0 00000000 b0000000 0 01000000>;
};
spi@f00 {
device_type = "spi";
compatible = "mpc5200-spi\0mpc52xx-spi";
reg = <f00 20>;
interrupts = <2 d 0 2 e 0>;
interrupt-parent = <500>;
};
usb@1000 {
device_type = "usb-ohci-be";
compatible = "mpc5200-ohci\0mpc52xx-ohci\0ohci-be";
reg = <1000 ff>;
interrupts = <2 6 0>;
interrupt-parent = <500>;
};
bestcomm@1200 {
device_type = "dma-controller";
compatible = "mpc5200-bestcomm\0mpc52xx-bestcomm";
reg = <1200 80>;
interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
3 4 0 3 5 0 3 6 0 3 7 0
3 8 0 3 9 0 3 a 0 3 b 0
3 c 0 3 d 0 3 e 0 3 f 0>;
interrupt-parent = <500>;
};
xlb@1f00 {
compatible = "mpc5200-xlb\0mpc52xx-xlb";
reg = <1f00 100>;
};
serial@2000 { // PSC1
device_type = "serial";
compatible = "mpc5200-psc-uart\0mpc52xx-psc-uart";
port-number = <0>; // Logical port assignment
reg = <2000 100>;
interrupts = <2 1 0>;
interrupt-parent = <500>;
};
// PSC2 in spi mode example
spi@2200 { // PSC2
device_type = "spi";
compatible = "mpc5200-psc-spi\0mpc52xx-psc-spi";
reg = <2200 100>;
interrupts = <2 2 0>;
interrupt-parent = <500>;
};
// PSC3 in CODEC mode example
i2s@2400 { // PSC3
device_type = "i2s";
compatible = "mpc5200-psc-i2s\0mpc52xx-psc-i2s";
reg = <2400 100>;
interrupts = <2 3 0>;
interrupt-parent = <500>;
};
// PSC4 unconfigured
//serial@2600 { // PSC4
// device_type = "serial";
// compatible = "mpc5200-psc-uart\0mpc52xx-psc-uart";
// reg = <2600 100>;
// interrupts = <2 b 0>;
// interrupt-parent = <500>;
//};
// PSC5 unconfigured
//serial@2800 { // PSC5
// device_type = "serial";
// compatible = "mpc5200-psc-uart\0mpc52xx-psc-uart";
// reg = <2800 100>;
// interrupts = <2 c 0>;
// interrupt-parent = <500>;
//};
// PSC6 in AC97 mode example
ac97@2c00 { // PSC6
device_type = "ac97";
compatible = "mpc5200-psc-ac97\0mpc52xx-psc-ac97";
reg = <2c00 100>;
interrupts = <2 4 0>;
interrupt-parent = <500>;
};
ethernet@3000 {
device_type = "network";
compatible = "mpc5200-fec\0mpc52xx-fec";
reg = <3000 800>;
mac-address = [ 02 03 04 05 06 07 ]; // Bad!
interrupts = <2 5 0>;
interrupt-parent = <500>;
};
ata@3a00 {
device_type = "ata";
compatible = "mpc5200-ata\0mpc52xx-ata";
reg = <3a00 100>;
interrupts = <2 7 0>;
interrupt-parent = <500>;
};
i2c@3d00 {
device_type = "i2c";
compatible = "mpc5200-i2c\0mpc52xx-i2c";
reg = <3d00 40>;
interrupts = <2 f 0>;
interrupt-parent = <500>;
};
i2c@3d40 {
device_type = "i2c";
compatible = "mpc5200-i2c\0mpc52xx-i2c";
reg = <3d40 40>;
interrupts = <2 10 0>;
interrupt-parent = <500>;
};
sram@8000 {
device_type = "sram";
compatible = "mpc5200-sram\0mpc52xx-sram\0sram";
reg = <8000 4000>;
};
};
};
/*
* Lite5200B board Device Tree Source
*
* Copyright 2006 Secret Lab Technologies Ltd.
* Grant Likely <grant.likely@secretlab.ca>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
/ {
model = "Lite5200b";
compatible = "lite5200b\0lite52xx\0mpc5200b\0mpc52xx";
#address-cells = <1>;
#size-cells = <1>;
cpus {
#cpus = <1>;
#address-cells = <1>;
#size-cells = <0>;
PowerPC,5200@0 {
device_type = "cpu";
reg = <0>;
d-cache-line-size = <20>;
i-cache-line-size = <20>;
d-cache-size = <4000>; // L1, 16K
i-cache-size = <4000>; // L1, 16K
timebase-frequency = <0>; // from bootloader
bus-frequency = <0>; // from bootloader
clock-frequency = <0>; // from bootloader
32-bit;
};
};
memory {
device_type = "memory";
reg = <00000000 10000000>; // 256MB
};
soc5200@f0000000 {
#interrupt-cells = <3>;
device_type = "soc";
ranges = <0 f0000000 f0010000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
cdm@200 {
compatible = "mpc5200b-cdm\0mpc52xx-cdm";
reg = <200 38>;
};
pic@500 {
// 5200 interrupts are encoded into two levels;
linux,phandle = <500>;
interrupt-controller;
#interrupt-cells = <3>;
device_type = "interrupt-controller";
compatible = "mpc5200b-pic\0mpc52xx-pic";
reg = <500 80>;
built-in;
};
gpt@600 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <600 10>;
interrupts = <1 9 0>;
interrupt-parent = <500>;
};
gpt@610 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <610 10>;
interrupts = <1 a 0>;
interrupt-parent = <500>;
};
gpt@620 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <620 10>;
interrupts = <1 b 0>;
interrupt-parent = <500>;
};
gpt@630 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <630 10>;
interrupts = <1 c 0>;
interrupt-parent = <500>;
};
gpt@640 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <640 10>;
interrupts = <1 d 0>;
interrupt-parent = <500>;
};
gpt@650 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <650 10>;
interrupts = <1 e 0>;
interrupt-parent = <500>;
};
gpt@660 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <660 10>;
interrupts = <1 f 0>;
interrupt-parent = <500>;
};
gpt@670 { // General Purpose Timer
compatible = "mpc5200b-gpt\0mpc52xx-gpt";
device_type = "gpt";
reg = <670 10>;
interrupts = <1 10 0>;
interrupt-parent = <500>;
};
rtc@800 { // Real time clock
compatible = "mpc5200b-rtc\0mpc52xx-rtc";
device_type = "rtc";
reg = <800 100>;
interrupts = <1 5 0 1 6 0>;
interrupt-parent = <500>;
};
mscan@900 {
device_type = "mscan";
compatible = "mpc5200b-mscan\0mpc52xx-mscan";
interrupts = <2 11 0>;
interrupt-parent = <500>;
reg = <900 80>;
};
mscan@980 {
device_type = "mscan";
compatible = "mpc5200b-mscan\0mpc52xx-mscan";
interrupts = <1 12 0>;
interrupt-parent = <500>;
reg = <980 80>;
};
gpio@b00 {
compatible = "mpc5200b-gpio\0mpc52xx-gpio";
reg = <b00 40>;
interrupts = <1 7 0>;
interrupt-parent = <500>;
};
gpio-wkup@b00 {
compatible = "mpc5200b-gpio-wkup\0mpc52xx-gpio-wkup";
reg = <c00 40>;
interrupts = <1 8 0 0 3 0>;
interrupt-parent = <500>;
};
pci@0d00 {
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
compatible = "mpc5200b-pci\0mpc52xx-pci";
reg = <d00 100>;
interrupt-map-mask = <f800 0 0 7>;
interrupt-map = <c000 0 0 1 500 0 0 3 // 1st slot
c000 0 0 2 500 1 1 3
c000 0 0 3 500 1 2 3
c000 0 0 4 500 1 3 3
c800 0 0 1 500 1 1 3 // 2nd slot
c800 0 0 2 500 1 2 3
c800 0 0 3 500 1 3 3
c800 0 0 4 500 0 0 3>;
clock-frequency = <0>; // From boot loader
interrupts = <2 8 0 2 9 0 2 a 0>;
interrupt-parent = <500>;
bus-range = <0 0>;
ranges = <42000000 0 80000000 80000000 0 20000000
02000000 0 a0000000 a0000000 0 10000000
01000000 0 00000000 b0000000 0 01000000>;
};
spi@f00 {
device_type = "spi";
compatible = "mpc5200b-spi\0mpc52xx-spi";
reg = <f00 20>;
interrupts = <2 d 0 2 e 0>;
interrupt-parent = <500>;
};
usb@1000 {
device_type = "usb-ohci-be";
compatible = "mpc5200b-ohci\0mpc52xx-ohci\0ohci-be";
reg = <1000 ff>;
interrupts = <2 6 0>;
interrupt-parent = <500>;
};
bestcomm@1200 {
device_type = "dma-controller";
compatible = "mpc5200b-bestcomm\0mpc52xx-bestcomm";
reg = <1200 80>;
interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
3 4 0 3 5 0 3 6 0 3 7 0
3 8 0 3 9 0 3 a 0 3 b 0
3 c 0 3 d 0 3 e 0 3 f 0>;
interrupt-parent = <500>;
};
xlb@1f00 {
compatible = "mpc5200b-xlb\0mpc52xx-xlb";
reg = <1f00 100>;
};
serial@2000 { // PSC1
device_type = "serial";
compatible = "mpc5200b-psc-uart\0mpc52xx-psc-uart";
port-number = <0>; // Logical port assignment
reg = <2000 100>;
interrupts = <2 1 0>;
interrupt-parent = <500>;
};
// PSC2 in spi mode example
spi@2200 { // PSC2
device_type = "spi";
compatible = "mpc5200b-psc-spi\0mpc52xx-psc-spi";
reg = <2200 100>;
interrupts = <2 2 0>;
interrupt-parent = <500>;
};
// PSC3 in CODEC mode example
i2s@2400 { // PSC3
device_type = "i2s";
compatible = "mpc5200b-psc-i2s\0mpc52xx-psc-i2s";
reg = <2400 100>;
interrupts = <2 3 0>;
interrupt-parent = <500>;
};
// PSC4 unconfigured
//serial@2600 { // PSC4
// device_type = "serial";
// compatible = "mpc5200b-psc-uart\0mpc52xx-psc-uart";
// reg = <2600 100>;
// interrupts = <2 b 0>;
// interrupt-parent = <500>;
//};
// PSC5 unconfigured
//serial@2800 { // PSC5
// device_type = "serial";
// compatible = "mpc5200b-psc-uart\0mpc52xx-psc-uart";
// reg = <2800 100>;
// interrupts = <2 c 0>;
// interrupt-parent = <500>;
//};
// PSC6 in AC97 mode example
ac97@2c00 { // PSC6
device_type = "ac97";
compatible = "mpc5200b-psc-ac97\0mpc52xx-psc-ac97";
reg = <2c00 100>;
interrupts = <2 4 0>;
interrupt-parent = <500>;
};
ethernet@3000 {
device_type = "network";
compatible = "mpc5200b-fec\0mpc52xx-fec";
reg = <3000 800>;
mac-address = [ 02 03 04 05 06 07 ]; // Bad!
interrupts = <2 5 0>;
interrupt-parent = <500>;
};
ata@3a00 {
device_type = "ata";
compatible = "mpc5200b-ata\0mpc52xx-ata";
reg = <3a00 100>;
interrupts = <2 7 0>;
interrupt-parent = <500>;
};
i2c@3d00 {
device_type = "i2c";
compatible = "mpc5200b-i2c\0mpc52xx-i2c";
reg = <3d00 40>;
interrupts = <2 f 0>;
interrupt-parent = <500>;
};
i2c@3d40 {
device_type = "i2c";
compatible = "mpc5200b-i2c\0mpc52xx-i2c";
reg = <3d40 40>;
interrupts = <2 10 0>;
interrupt-parent = <500>;
};
sram@8000 {
device_type = "sram";
compatible = "mpc5200b-sram\0mpc52xx-sram\0sram";
reg = <8000 4000>;
};
};
};
...@@ -161,29 +161,41 @@ ...@@ -161,29 +161,41 @@
interrupt-map = < interrupt-map = <
/* IDSEL 0x11 */ /* IDSEL 0x11 */
0800 0 0 1 7400 24 0 0800 0 0 1 1180 24 0
0800 0 0 2 7400 25 0 0800 0 0 2 1180 25 0
0800 0 0 3 7400 26 0 0800 0 0 3 1180 26 0
0800 0 0 4 7400 27 0 0800 0 0 4 1180 27 0
/* IDSEL 0x12 */ /* IDSEL 0x12 */
1000 0 0 1 7400 25 0 1000 0 0 1 1180 25 0
1000 0 0 2 7400 26 0 1000 0 0 2 1180 26 0
1000 0 0 3 7400 27 0 1000 0 0 3 1180 27 0
1000 0 0 4 7400 24 0 1000 0 0 4 1180 24 0
/* IDSEL 0x13 */ /* IDSEL 0x13 */
1800 0 0 1 7400 26 0 1800 0 0 1 1180 26 0
1800 0 0 2 7400 27 0 1800 0 0 2 1180 27 0
1800 0 0 3 7400 24 0 1800 0 0 3 1180 24 0
1800 0 0 4 7400 25 0 1800 0 0 4 1180 25 0
/* IDSEL 0x14 */ /* IDSEL 0x14 */
2000 0 0 1 7400 27 0 2000 0 0 1 1180 27 0
2000 0 0 2 7400 24 0 2000 0 0 2 1180 24 0
2000 0 0 3 7400 25 0 2000 0 0 3 1180 25 0
2000 0 0 4 7400 26 0 2000 0 0 4 1180 26 0
>; >;
router@1180 {
linux,phandle = <1180>;
clock-frequency = <0>;
interrupt-controller;
device_type = "pic-router";
#address-cells = <0>;
#interrupt-cells = <2>;
built-in;
big-endian;
interrupts = <17 2>;
interrupt-parent = <7400>;
};
}; };
}; };
......
This diff is collapsed.
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#ifndef FLATDEVTREE_H #ifndef FLATDEVTREE_H
#define FLATDEVTREE_H #define FLATDEVTREE_H
#include "types.h" #include "flatdevtree_env.h"
/* Definitions used by the flattened device tree */ /* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */ #define OF_DT_HEADER 0xd00dfeed /* marker */
...@@ -43,4 +43,64 @@ struct boot_param_header { ...@@ -43,4 +43,64 @@ struct boot_param_header {
u32 dt_strings_size; /* size of the DT strings block */ u32 dt_strings_size; /* size of the DT strings block */
}; };
struct ft_reserve {
u64 start;
u64 len;
};
struct ft_region {
char *start;
unsigned long size;
};
enum ft_rgn_id {
FT_RSVMAP,
FT_STRUCT,
FT_STRINGS,
FT_N_REGION
};
#define FT_MAX_DEPTH 50
struct ft_cxt {
struct boot_param_header *bph;
int max_size; /* maximum size of tree */
int isordered; /* everything in standard order */
void *(*realloc)(void *, unsigned long);
char *str_anchor;
char *p; /* current insertion point in structs */
struct ft_region rgn[FT_N_REGION];
void *genealogy[FT_MAX_DEPTH+1];
char **node_tbl;
unsigned int node_max;
unsigned int nodes_used;
};
int ft_begin_node(struct ft_cxt *cxt, const char *name);
void ft_end_node(struct ft_cxt *cxt);
void ft_begin_tree(struct ft_cxt *cxt);
void ft_end_tree(struct ft_cxt *cxt);
void ft_nop(struct ft_cxt *cxt);
int ft_prop(struct ft_cxt *cxt, const char *name,
const void *data, unsigned int sz);
int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val);
void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
void *(*realloc_fn)(void *, unsigned long));
int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
unsigned int max_find_device,
void *(*realloc_fn)(void *, unsigned long));
int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
void ft_dump_blob(const void *bphp);
void ft_merge_blob(struct ft_cxt *cxt, void *blob);
void *ft_find_device(struct ft_cxt *cxt, const char *srch_path);
void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
void *buf, const unsigned int buflen);
int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
const void *buf, const unsigned int buflen);
#endif /* FLATDEVTREE_H */ #endif /* FLATDEVTREE_H */
/*
* This file adds the header file glue so that the shared files
* flatdevicetree.[ch] can compile and work in the powerpc bootwrapper.
*
* strncmp & strchr copied from <file:lib/strings.c>
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Maintained by: Mark A. Greer <mgreer@mvista.com>
*/
#ifndef _PPC_BOOT_FLATDEVTREE_ENV_H_
#define _PPC_BOOT_FLATDEVTREE_ENV_H_
#include <stdarg.h>
#include <stddef.h>
#include "types.h"
#include "string.h"
#include "stdio.h"
#include "ops.h"
#define be16_to_cpu(x) (x)
#define cpu_to_be16(x) (x)
#define be32_to_cpu(x) (x)
#define cpu_to_be32(x) (x)
#define be64_to_cpu(x) (x)
#define cpu_to_be64(x) (x)
static inline int strncmp(const char *cs, const char *ct, size_t count)
{
signed char __res = 0;
while (count) {
if ((__res = *cs - *ct++) != 0 || !*cs++)
break;
count--;
}
return __res;
}
static inline char *strchr(const char *s, int c)
{
for (; *s != (char)c; ++s)
if (*s == '\0')
return NULL;
return (char *)s;
}
#endif /* _PPC_BOOT_FLATDEVTREE_ENV_H_ */
/*
* This file does the necessary interface mapping between the bootwrapper
* device tree operations and the interface provided by shared source
* files flatdevicetree.[ch].
*
* Author: Mark A. Greer <mgreer@mvista.com>
*
* 2006 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <stddef.h>
#include "flatdevtree.h"
#include "ops.h"
static struct ft_cxt cxt;
static void *ft_finddevice(const char *name)
{
return ft_find_device(&cxt, name);
}
static int ft_getprop(const void *phandle, const char *propname, void *buf,
const int buflen)
{
return ft_get_prop(&cxt, phandle, propname, buf, buflen);
}
static int ft_setprop(const void *phandle, const char *propname,
const void *buf, const int buflen)
{
return ft_set_prop(&cxt, phandle, propname, buf, buflen);
}
static unsigned long ft_finalize(void)
{
ft_end_tree(&cxt);
return (unsigned long)cxt.bph;
}
int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
{
dt_ops.finddevice = ft_finddevice;
dt_ops.getprop = ft_getprop;
dt_ops.setprop = ft_setprop;
dt_ops.finalize = ft_finalize;
return ft_open(&cxt, dt_blob, max_size, max_find_device,
platform_ops.realloc);
}
#ifndef _IO_H
#define __IO_H
/*
* Low-level I/O routines.
*
* Copied from <file:include/asm-powerpc/io.h> (which has no copyright)
*/
static inline int in_8(const volatile unsigned char *addr)
{
int ret;
__asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
static inline void out_8(volatile unsigned char *addr, int val)
{
__asm__ __volatile__("stb%U0%X0 %1,%0; sync"
: "=m" (*addr) : "r" (val));
}
static inline unsigned in_le32(const volatile unsigned *addr)
{
unsigned ret;
__asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "r" (addr), "m" (*addr));
return ret;
}
static inline unsigned in_be32(const volatile unsigned *addr)
{
unsigned ret;
__asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
static inline void out_le32(volatile unsigned *addr, int val)
{
__asm__ __volatile__("stwbrx %1,0,%2; sync" : "=m" (*addr)
: "r" (val), "r" (addr));
}
static inline void out_be32(volatile unsigned *addr, int val)
{
__asm__ __volatile__("stw%U0%X0 %1,%0; sync"
: "=m" (*addr) : "r" (val));
}
#endif /* _IO_H */
...@@ -27,6 +27,8 @@ extern char _vmlinux_start[]; ...@@ -27,6 +27,8 @@ extern char _vmlinux_start[];
extern char _vmlinux_end[]; extern char _vmlinux_end[];
extern char _initrd_start[]; extern char _initrd_start[];
extern char _initrd_end[]; extern char _initrd_end[];
extern char _dtb_start[];
extern char _dtb_end[];
struct addr_range { struct addr_range {
unsigned long addr; unsigned long addr;
...@@ -167,7 +169,7 @@ static int is_elf32(void *hdr) ...@@ -167,7 +169,7 @@ static int is_elf32(void *hdr)
return 1; return 1;
} }
static void prep_kernel(unsigned long *a1, unsigned long *a2) static void prep_kernel(unsigned long a1, unsigned long a2)
{ {
int len; int len;
...@@ -203,11 +205,14 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2) ...@@ -203,11 +205,14 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2)
} }
/* /*
* Now we try to alloc memory for the initrd (and copy it there) * Now find the initrd
*
* First see if we have an image attached to us. If so
* allocate memory for it and copy it there.
*/ */
initrd.size = (unsigned long)(_initrd_end - _initrd_start); initrd.size = (unsigned long)(_initrd_end - _initrd_start);
initrd.memsize = initrd.size; initrd.memsize = initrd.size;
if ( initrd.size > 0 ) { if (initrd.size > 0) {
printf("Allocating 0x%lx bytes for initrd ...\n\r", printf("Allocating 0x%lx bytes for initrd ...\n\r",
initrd.size); initrd.size);
initrd.addr = (unsigned long)malloc((u32)initrd.size); initrd.addr = (unsigned long)malloc((u32)initrd.size);
...@@ -216,8 +221,6 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2) ...@@ -216,8 +221,6 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2)
"ramdisk !\n\r"); "ramdisk !\n\r");
exit(); exit();
} }
*a1 = initrd.addr;
*a2 = initrd.size;
printf("initial ramdisk moving 0x%lx <- 0x%lx " printf("initial ramdisk moving 0x%lx <- 0x%lx "
"(0x%lx bytes)\n\r", initrd.addr, "(0x%lx bytes)\n\r", initrd.addr,
(unsigned long)_initrd_start, initrd.size); (unsigned long)_initrd_start, initrd.size);
...@@ -225,6 +228,12 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2) ...@@ -225,6 +228,12 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2)
initrd.size); initrd.size);
printf("initrd head: 0x%lx\n\r", printf("initrd head: 0x%lx\n\r",
*((unsigned long *)initrd.addr)); *((unsigned long *)initrd.addr));
} else if (a2 != 0) {
/* Otherwise, see if yaboot or another loader gave us an initrd */
initrd.addr = a1;
initrd.memsize = initrd.size = a2;
printf("Using loader supplied initrd at 0x%lx (0x%lx bytes)\n\r",
initrd.addr, initrd.size);
} }
/* Eventually gunzip the kernel */ /* Eventually gunzip the kernel */
...@@ -250,10 +259,6 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2) ...@@ -250,10 +259,6 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2)
flush_cache((void *)vmlinux.addr, vmlinux.size); flush_cache((void *)vmlinux.addr, vmlinux.size);
} }
void __attribute__ ((weak)) ft_init(void *dt_blob)
{
}
/* A buffer that may be edited by tools operating on a zImage binary so as to /* A buffer that may be edited by tools operating on a zImage binary so as to
* edit the command line passed to vmlinux (by setting /chosen/bootargs). * edit the command line passed to vmlinux (by setting /chosen/bootargs).
* The buffer is put in it's own section so that tools may locate it easier. * The buffer is put in it's own section so that tools may locate it easier.
...@@ -285,36 +290,22 @@ static void set_cmdline(char *buf) ...@@ -285,36 +290,22 @@ static void set_cmdline(char *buf)
setprop(devp, "bootargs", buf, strlen(buf) + 1); setprop(devp, "bootargs", buf, strlen(buf) + 1);
} }
/* Section where ft can be tacked on after zImage is built */
union blobspace {
struct boot_param_header hdr;
char space[8*1024];
} dt_blob __attribute__((__section__("__builtin_ft")));
struct platform_ops platform_ops; struct platform_ops platform_ops;
struct dt_ops dt_ops; struct dt_ops dt_ops;
struct console_ops console_ops; struct console_ops console_ops;
void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
{ {
int have_dt = 0;
kernel_entry_t kentry; kernel_entry_t kentry;
char cmdline[COMMAND_LINE_SIZE]; char cmdline[COMMAND_LINE_SIZE];
unsigned long ft_addr = 0;
memset(__bss_start, 0, _end - __bss_start); memset(__bss_start, 0, _end - __bss_start);
memset(&platform_ops, 0, sizeof(platform_ops)); memset(&platform_ops, 0, sizeof(platform_ops));
memset(&dt_ops, 0, sizeof(dt_ops)); memset(&dt_ops, 0, sizeof(dt_ops));
memset(&console_ops, 0, sizeof(console_ops)); memset(&console_ops, 0, sizeof(console_ops));
/* Override the dt_ops and device tree if there was an flat dev if (platform_init(promptr, _dtb_start, _dtb_end))
* tree attached to the zImage.
*/
if (dt_blob.hdr.magic == OF_DT_HEADER) {
have_dt = 1;
ft_init(&dt_blob);
}
if (platform_init(promptr))
exit(); exit();
if (console_ops.open && (console_ops.open() < 0)) if (console_ops.open && (console_ops.open() < 0))
exit(); exit();
...@@ -324,7 +315,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) ...@@ -324,7 +315,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r",
_start, sp); _start, sp);
prep_kernel(&a1, &a2); prep_kernel(a1, a2);
/* If cmdline came from zimage wrapper or if we can edit the one /* If cmdline came from zimage wrapper or if we can edit the one
* in the dt, print it out and edit it, if possible. * in the dt, print it out and edit it, if possible.
...@@ -338,15 +329,23 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) ...@@ -338,15 +329,23 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
set_cmdline(cmdline); set_cmdline(cmdline);
} }
printf("Finalizing device tree...");
if (dt_ops.finalize)
ft_addr = dt_ops.finalize();
if (ft_addr)
printf(" flat tree at 0x%lx\n\r", ft_addr);
else
printf(" using OF tree (promptr=%p)\n\r", promptr);
if (console_ops.close) if (console_ops.close)
console_ops.close(); console_ops.close();
kentry = (kernel_entry_t) vmlinux.addr; kentry = (kernel_entry_t) vmlinux.addr;
if (have_dt) if (ft_addr)
kentry(dt_ops.ft_addr(), 0, NULL); kentry(ft_addr, 0, NULL);
else else
/* XXX initrd addr/size should be passed in properties */ /* XXX initrd addr/size should be passed in properties */
kentry(a1, a2, promptr); kentry(initrd.addr, initrd.size, promptr);
/* console closed so printf below may not work */ /* console closed so printf below may not work */
printf("Error: Linux kernel returned to zImage boot wrapper!\n\r"); printf("Error: Linux kernel returned to zImage boot wrapper!\n\r");
......
/*
* Makes a tree bootable image for IBM Evaluation boards.
* Basically, just take a zImage, skip the ELF header, and stuff
* a 32 byte header on the front.
*
* We use htonl, which is a network macro, to make sure we're doing
* The Right Thing on an LE machine. It's non-obvious, but it should
* work on anything BSD'ish.
*/
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <netinet/in.h>
#ifdef __sun__
#include <inttypes.h>
#else
#include <stdint.h>
#endif
/* This gets tacked on the front of the image. There are also a few
* bytes allocated after the _start label used by the boot rom (see
* head.S for details).
*/
typedef struct boot_block {
uint32_t bb_magic; /* 0x0052504F */
uint32_t bb_dest; /* Target address of the image */
uint32_t bb_num_512blocks; /* Size, rounded-up, in 512 byte blks */
uint32_t bb_debug_flag; /* Run debugger or image after load */
uint32_t bb_entry_point; /* The image address to start */
uint32_t bb_checksum; /* 32 bit checksum including header */
uint32_t reserved[2];
} boot_block_t;
#define IMGBLK 512
char tmpbuf[IMGBLK];
int main(int argc, char *argv[])
{
int in_fd, out_fd;
int nblks, i;
uint cksum, *cp;
struct stat st;
boot_block_t bt;
if (argc < 3) {
fprintf(stderr, "usage: %s <zImage-file> <boot-image> [entry-point]\n",argv[0]);
exit(1);
}
if (stat(argv[1], &st) < 0) {
perror("stat");
exit(2);
}
nblks = (st.st_size + IMGBLK) / IMGBLK;
bt.bb_magic = htonl(0x0052504F);
/* If we have the optional entry point parameter, use it */
if (argc == 4)
bt.bb_dest = bt.bb_entry_point = htonl(strtoul(argv[3], NULL, 0));
else
bt.bb_dest = bt.bb_entry_point = htonl(0x500000);
/* We know these from the linker command.
* ...and then move it up into memory a little more so the
* relocation can happen.
*/
bt.bb_num_512blocks = htonl(nblks);
bt.bb_debug_flag = 0;
bt.bb_checksum = 0;
/* To be neat and tidy :-).
*/
bt.reserved[0] = 0;
bt.reserved[1] = 0;
if ((in_fd = open(argv[1], O_RDONLY)) < 0) {
perror("zImage open");
exit(3);
}
if ((out_fd = open(argv[2], (O_RDWR | O_CREAT | O_TRUNC), 0666)) < 0) {
perror("bootfile open");
exit(3);
}
cksum = 0;
cp = (void *)&bt;
for (i=0; i<sizeof(bt)/sizeof(uint); i++)
cksum += *cp++;
/* Assume zImage is an ELF file, and skip the 64K header.
*/
if (read(in_fd, tmpbuf, IMGBLK) != IMGBLK) {
fprintf(stderr, "%s is too small to be an ELF image\n",
argv[1]);
exit(4);
}
if ((*(uint *)tmpbuf) != htonl(0x7f454c46)) {
fprintf(stderr, "%s is not an ELF image\n", argv[1]);
exit(4);
}
if (lseek(in_fd, (64 * 1024), SEEK_SET) < 0) {
fprintf(stderr, "%s failed to seek in ELF image\n", argv[1]);
exit(4);
}
nblks -= (64 * 1024) / IMGBLK;
/* And away we go......
*/
if (write(out_fd, &bt, sizeof(bt)) != sizeof(bt)) {
perror("boot-image write");
exit(5);
}
while (nblks-- > 0) {
if (read(in_fd, tmpbuf, IMGBLK) < 0) {
perror("zImage read");
exit(5);
}
cp = (uint *)tmpbuf;
for (i=0; i<sizeof(tmpbuf)/sizeof(uint); i++)
cksum += *cp++;
if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
perror("boot-image write");
exit(5);
}
}
/* rewrite the header with the computed checksum.
*/
bt.bb_checksum = htonl(cksum);
if (lseek(out_fd, 0, SEEK_SET) < 0) {
perror("rewrite seek");
exit(1);
}
if (write(out_fd, &bt, sizeof(bt)) != sizeof(bt)) {
perror("boot-image rewrite");
exit(1);
}
exit(0);
}
/*
* 16550 serial console support.
*
* Original copied from <file:arch/ppc/boot/common/ns16550.c>
* (which had no copyright)
* Modifications: 2006 (c) MontaVista Software, Inc.
*
* Modified by: Mark A. Greer <mgreer@mvista.com>
*/
#include <stdarg.h>
#include <stddef.h>
#include "types.h"
#include "string.h"
#include "stdio.h"
#include "io.h"
#include "ops.h"
#define UART_DLL 0 /* Out: Divisor Latch Low */
#define UART_DLM 1 /* Out: Divisor Latch High */
#define UART_FCR 2 /* Out: FIFO Control Register */
#define UART_LCR 3 /* Out: Line Control Register */
#define UART_MCR 4 /* Out: Modem Control Register */
#define UART_LSR 5 /* In: Line Status Register */
#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
#define UART_LSR_DR 0x01 /* Receiver data ready */
#define UART_MSR 6 /* In: Modem Status Register */
#define UART_SCR 7 /* I/O: Scratch Register */
static unsigned char *reg_base;
static u32 reg_shift;
static int ns16550_open(void)
{
out_8(reg_base + (UART_FCR << reg_shift), 0x06);
return 0;
}
static void ns16550_putc(unsigned char c)
{
while ((in_8(reg_base + (UART_LSR << reg_shift)) & UART_LSR_THRE) == 0);
out_8(reg_base, c);
}
static unsigned char ns16550_getc(void)
{
while ((in_8(reg_base + (UART_LSR << reg_shift)) & UART_LSR_DR) == 0);
return in_8(reg_base);
}
static u8 ns16550_tstc(void)
{
return ((in_8(reg_base + (UART_LSR << reg_shift)) & UART_LSR_DR) != 0);
}
int ns16550_console_init(void *devp, struct serial_console_data *scdp)
{
int n;
n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
if (n != sizeof(reg_base))
return -1;
n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift))
reg_shift = 0;
scdp->open = ns16550_open;
scdp->putc = ns16550_putc;
scdp->getc = ns16550_getc;
scdp->tstc = ns16550_tstc;
scdp->close = NULL;
return 0;
}
...@@ -256,24 +256,18 @@ static void of_console_write(char *buf, int len) ...@@ -256,24 +256,18 @@ static void of_console_write(char *buf, int len)
call_prom("write", 3, 1, of_stdout_handle, buf, len); call_prom("write", 3, 1, of_stdout_handle, buf, len);
} }
int platform_init(void *promptr) int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end)
{ {
platform_ops.fixups = NULL;
platform_ops.image_hdr = of_image_hdr; platform_ops.image_hdr = of_image_hdr;
platform_ops.malloc = of_try_claim; platform_ops.malloc = of_try_claim;
platform_ops.free = NULL;
platform_ops.exit = of_exit; platform_ops.exit = of_exit;
dt_ops.finddevice = of_finddevice; dt_ops.finddevice = of_finddevice;
dt_ops.getprop = of_getprop; dt_ops.getprop = of_getprop;
dt_ops.setprop = of_setprop; dt_ops.setprop = of_setprop;
dt_ops.translate_addr = NULL;
console_ops.open = of_console_open; console_ops.open = of_console_open;
console_ops.write = of_console_write; console_ops.write = of_console_write;
console_ops.edit_cmdline = NULL;
console_ops.close = NULL;
console_ops.data = NULL;
prom = (int (*)(void *))promptr; prom = (int (*)(void *))promptr;
return 0; return 0;
......
...@@ -22,7 +22,8 @@ struct platform_ops { ...@@ -22,7 +22,8 @@ struct platform_ops {
void (*fixups)(void); void (*fixups)(void);
void (*image_hdr)(const void *); void (*image_hdr)(const void *);
void * (*malloc)(u32 size); void * (*malloc)(u32 size);
void (*free)(void *ptr, u32 size); void (*free)(void *ptr);
void * (*realloc)(void *ptr, unsigned long size);
void (*exit)(void); void (*exit)(void);
}; };
extern struct platform_ops platform_ops; extern struct platform_ops platform_ops;
...@@ -30,13 +31,11 @@ extern struct platform_ops platform_ops; ...@@ -30,13 +31,11 @@ extern struct platform_ops platform_ops;
/* Device Tree operations */ /* Device Tree operations */
struct dt_ops { struct dt_ops {
void * (*finddevice)(const char *name); void * (*finddevice)(const char *name);
int (*getprop)(const void *node, const char *name, void *buf, int (*getprop)(const void *phandle, const char *name, void *buf,
const int buflen); const int buflen);
int (*setprop)(const void *node, const char *name, int (*setprop)(const void *phandle, const char *name,
const void *buf, const int buflen); const void *buf, const int buflen);
u64 (*translate_addr)(const char *path, const u32 *in_addr, unsigned long (*finalize)(void);
const u32 addr_len);
unsigned long (*ft_addr)(void);
}; };
extern struct dt_ops dt_ops; extern struct dt_ops dt_ops;
...@@ -59,10 +58,13 @@ struct serial_console_data { ...@@ -59,10 +58,13 @@ struct serial_console_data {
void (*close)(void); void (*close)(void);
}; };
extern int platform_init(void *promptr); int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end);
extern void simple_alloc_init(void); int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
extern void ft_init(void *dt_blob); int serial_console_init(void);
extern int serial_console_init(void); int ns16550_console_init(void *devp, struct serial_console_data *scdp);
void *simple_alloc_init(char *base, u32 heap_size, u32 granularity,
u32 max_allocs);
static inline void *finddevice(const char *name) static inline void *finddevice(const char *name)
{ {
...@@ -84,10 +86,10 @@ static inline void *malloc(u32 size) ...@@ -84,10 +86,10 @@ static inline void *malloc(u32 size)
return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL;
} }
static inline void free(void *ptr, u32 size) static inline void free(void *ptr)
{ {
if (platform_ops.free) if (platform_ops.free)
platform_ops.free(ptr, size); platform_ops.free(ptr);
} }
static inline void exit(void) static inline void exit(void)
......
/*
* Generic serial console support
*
* Author: Mark A. Greer <mgreer@mvista.com>
*
* Code in serial_edit_cmdline() copied from <file:arch/ppc/boot/simple/misc.c>
* and was written by Matt Porter <mporter@kernel.crashing.org>.
*
* 2001,2006 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <stdarg.h>
#include <stddef.h>
#include "types.h"
#include "string.h"
#include "stdio.h"
#include "io.h"
#include "ops.h"
extern void udelay(long delay);
static int serial_open(void)
{
struct serial_console_data *scdp = console_ops.data;
return scdp->open();
}
static void serial_write(char *buf, int len)
{
struct serial_console_data *scdp = console_ops.data;
while (*buf != '\0')
scdp->putc(*buf++);
}
static void serial_edit_cmdline(char *buf, int len)
{
int timer = 0, count;
char ch, *cp;
struct serial_console_data *scdp = console_ops.data;
cp = buf;
count = strlen(buf);
cp = &buf[count];
count++;
while (timer++ < 5*1000) {
if (scdp->tstc()) {
while (((ch = scdp->getc()) != '\n') && (ch != '\r')) {
/* Test for backspace/delete */
if ((ch == '\b') || (ch == '\177')) {
if (cp != buf) {
cp--;
count--;
printf("\b \b");
}
/* Test for ^x/^u (and wipe the line) */
} else if ((ch == '\030') || (ch == '\025')) {
while (cp != buf) {
cp--;
count--;
printf("\b \b");
}
} else if (count < len) {
*cp++ = ch;
count++;
scdp->putc(ch);
}
}
break; /* Exit 'timer' loop */
}
udelay(1000); /* 1 msec */
}
*cp = 0;
}
static void serial_close(void)
{
struct serial_console_data *scdp = console_ops.data;
if (scdp->close)
scdp->close();
}
static void *serial_get_stdout_devp(void)
{
void *devp;
char devtype[MAX_PROP_LEN];
char path[MAX_PATH_LEN];
devp = finddevice("/chosen");
if (devp == NULL)
goto err_out;
if (getprop(devp, "linux,stdout-path", path, MAX_PATH_LEN) > 0) {
devp = finddevice(path);
if (devp == NULL)
goto err_out;
if ((getprop(devp, "device_type", devtype, sizeof(devtype)) > 0)
&& !strcmp(devtype, "serial"))
return devp;
}
err_out:
return NULL;
}
static struct serial_console_data serial_cd;
/* Node's "compatible" property determines which serial driver to use */
int serial_console_init(void)
{
void *devp;
int rc = -1;
char compat[MAX_PROP_LEN];
devp = serial_get_stdout_devp();
if (devp == NULL)
goto err_out;
if (getprop(devp, "compatible", compat, sizeof(compat)) < 0)
goto err_out;
if (!strcmp(compat, "ns16550"))
rc = ns16550_console_init(devp, &serial_cd);
/* Add other serial console driver calls here */
if (!rc) {
console_ops.open = serial_open;
console_ops.write = serial_write;
console_ops.edit_cmdline = serial_edit_cmdline;
console_ops.close = serial_close;
console_ops.data = &serial_cd;
return 0;
}
err_out:
return -1;
}
/*
* Implement primitive realloc(3) functionality.
*
* Author: Mark A. Greer <mgreer@mvista.com>
*
* 2006 (c) MontaVista, Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <stddef.h>
#include "types.h"
#include "page.h"
#include "string.h"
#include "ops.h"
#define ENTRY_BEEN_USED 0x01
#define ENTRY_IN_USE 0x02
static struct alloc_info {
u32 flags;
u32 base;
u32 size;
} *alloc_tbl;
static u32 tbl_entries;
static u32 alloc_min;
static u32 next_base;
static u32 space_left;
/*
* First time an entry is used, its base and size are set.
* An entry can be freed and re-malloc'd but its base & size don't change.
* Should be smart enough for needs of bootwrapper.
*/
static void *simple_malloc(u32 size)
{
u32 i;
struct alloc_info *p = alloc_tbl;
if (size == 0)
goto err_out;
size = _ALIGN_UP(size, alloc_min);
for (i=0; i<tbl_entries; i++, p++)
if (!(p->flags & ENTRY_BEEN_USED)) { /* never been used */
if (size <= space_left) {
p->base = next_base;
p->size = size;
p->flags = ENTRY_BEEN_USED | ENTRY_IN_USE;
next_base += size;
space_left -= size;
return (void *)p->base;
}
goto err_out; /* not enough space left */
}
/* reuse an entry keeping same base & size */
else if (!(p->flags & ENTRY_IN_USE) && (size <= p->size)) {
p->flags |= ENTRY_IN_USE;
return (void *)p->base;
}
err_out:
return NULL;
}
static struct alloc_info *simple_find_entry(void *ptr)
{
u32 i;
struct alloc_info *p = alloc_tbl;
for (i=0; i<tbl_entries; i++,p++) {
if (!(p->flags & ENTRY_BEEN_USED))
break;
if ((p->flags & ENTRY_IN_USE) && (p->base == (u32)ptr))
return p;
}
return NULL;
}
static void simple_free(void *ptr)
{
struct alloc_info *p = simple_find_entry(ptr);
if (p != NULL)
p->flags &= ~ENTRY_IN_USE;
}
/*
* Change size of area pointed to by 'ptr' to 'size'.
* If 'ptr' is NULL, then its a malloc(). If 'size' is 0, then its a free().
* 'ptr' must be NULL or a pointer to a non-freed area previously returned by
* simple_realloc() or simple_malloc().
*/
static void *simple_realloc(void *ptr, unsigned long size)
{
struct alloc_info *p;
void *new;
if (size == 0) {
simple_free(ptr);
return NULL;
}
if (ptr == NULL)
return simple_malloc(size);
p = simple_find_entry(ptr);
if (p == NULL) /* ptr not from simple_malloc/simple_realloc */
return NULL;
if (size <= p->size) /* fits in current block */
return ptr;
new = simple_malloc(size);
memcpy(new, ptr, p->size);
simple_free(ptr);
return new;
}
/*
* Returns addr of first byte after heap so caller can see if it took
* too much space. If so, change args & try again.
*/
void *simple_alloc_init(char *base, u32 heap_size, u32 granularity,
u32 max_allocs)
{
u32 heap_base, tbl_size;
heap_size = _ALIGN_UP(heap_size, granularity);
alloc_min = granularity;
tbl_entries = max_allocs;
tbl_size = tbl_entries * sizeof(struct alloc_info);
alloc_tbl = (struct alloc_info *)_ALIGN_UP((unsigned long)base, 8);
memset(alloc_tbl, 0, tbl_size);
heap_base = _ALIGN_UP((u32)alloc_tbl + tbl_size, alloc_min);
next_base = heap_base;
space_left = heap_size;
platform_ops.malloc = simple_malloc;
platform_ops.free = simple_free;
platform_ops.realloc = simple_realloc;
return (void *)(heap_base + heap_size);
}
...@@ -320,6 +320,7 @@ printf(const char *fmt, ...) ...@@ -320,6 +320,7 @@ printf(const char *fmt, ...)
va_start(args, fmt); va_start(args, fmt);
n = vsprintf(sprint_buf, fmt, args); n = vsprintf(sprint_buf, fmt, args);
va_end(args); va_end(args);
console_ops.write(sprint_buf, n); if (console_ops.write)
console_ops.write(sprint_buf, n);
return n; return n;
} }
/*
* Copied from <file:arch/powerpc/kernel/misc_32.S>
*
* This file contains miscellaneous low-level functions.
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
*
* Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
* and Paul Mackerras.
*
* kexec bits:
* Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
* GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/
#include "ppc_asm.h"
#define SPRN_PVR 0x11F /* Processor Version Register */
.text
/* udelay (on non-601 processors) needs to know the period of the
* timebase in nanoseconds. This used to be hardcoded to be 60ns
* (period of 66MHz/4). Now a variable is used that is initialized to
* 60 for backward compatibility, but it can be overridden as necessary
* with code something like this:
* extern unsigned long timebase_period_ns;
* timebase_period_ns = 1000000000 / bd->bi_tbfreq;
*/
.data
.globl timebase_period_ns
timebase_period_ns:
.long 60
.text
/*
* Delay for a number of microseconds
*/
.globl udelay
udelay:
mfspr r4,SPRN_PVR
srwi r4,r4,16
cmpwi 0,r4,1 /* 601 ? */
bne .udelay_not_601
00: li r0,86 /* Instructions / microsecond? */
mtctr r0
10: addi r0,r0,0 /* NOP */
bdnz 10b
subic. r3,r3,1
bne 00b
blr
.udelay_not_601:
mulli r4,r3,1000 /* nanoseconds */
/* Change r4 to be the number of ticks using:
* (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
* timebase_period_ns defaults to 60 (16.6MHz) */
mflr r5
bl 0f
0: mflr r6
mtlr r5
lis r5,0b@ha
addi r5,r5,0b@l
subf r5,r5,r6 /* In case we're relocated */
addis r5,r5,timebase_period_ns@ha
lwz r5,timebase_period_ns@l(r5)
add r4,r4,r5
addi r4,r4,-1
divw r4,r4,r5 /* BUS ticks */
1: mftbu r5
mftb r6
mftbu r7
cmpw 0,r5,r7
bne 1b /* Get [synced] base time */
addc r9,r6,r4 /* Compute end time */
addze r8,r5
2: mftbu r5
cmpw 0,r5,r8
blt 2b
bgt 3f
mftb r6
cmpw 0,r6,r9
blt 2b
3: blr
...@@ -184,6 +184,9 @@ fi ...@@ -184,6 +184,9 @@ fi
if [ -n "$dtb" ]; then if [ -n "$dtb" ]; then
addsec $tmp "$dtb" .kernel:dtb addsec $tmp "$dtb" .kernel:dtb
if [ -n "$dts" ]; then
rm $dtb
fi
fi fi
if [ "$platform" != "miboot" ]; then if [ "$platform" != "miboot" ]; then
......
...@@ -21,6 +21,10 @@ SECTIONS ...@@ -21,6 +21,10 @@ SECTIONS
*(.got2) *(.got2)
__got2_end = .; __got2_end = .;
_dtb_start = .;
*(.kernel:dtb)
_dtb_end = .;
_vmlinux_start = .; _vmlinux_start = .;
*(.kernel:vmlinux.strip) *(.kernel:vmlinux.strip)
_vmlinux_end = .; _vmlinux_end = .;
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.18 # Linux kernel version: 2.6.19-rc6
# Wed Oct 4 15:30:50 2006 # Wed Nov 22 15:33:04 2006
# #
CONFIG_PPC64=y CONFIG_PPC64=y
CONFIG_64BIT=y CONFIG_64BIT=y
...@@ -32,6 +32,10 @@ CONFIG_AUDIT_ARCH=y ...@@ -32,6 +32,10 @@ CONFIG_AUDIT_ARCH=y
CONFIG_POWER3=y CONFIG_POWER3=y
CONFIG_POWER4=y CONFIG_POWER4=y
CONFIG_PPC_FPU=y CONFIG_PPC_FPU=y
# CONFIG_PPC_DCR_NATIVE is not set
CONFIG_PPC_DCR_MMIO=y
CONFIG_PPC_DCR=y
CONFIG_PPC_OF_PLATFORM_PCI=y
CONFIG_ALTIVEC=y CONFIG_ALTIVEC=y
CONFIG_PPC_STD_MMU=y CONFIG_PPC_STD_MMU=y
CONFIG_VIRT_CPU_ACCOUNTING=y CONFIG_VIRT_CPU_ACCOUNTING=y
...@@ -67,7 +71,7 @@ CONFIG_INITRAMFS_SOURCE="" ...@@ -67,7 +71,7 @@ CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set # CONFIG_EMBEDDED is not set
# CONFIG_SYSCTL_SYSCALL is not set CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set
...@@ -131,6 +135,7 @@ CONFIG_PPC_CELL=y ...@@ -131,6 +135,7 @@ CONFIG_PPC_CELL=y
CONFIG_PPC_CELL_NATIVE=y CONFIG_PPC_CELL_NATIVE=y
CONFIG_PPC_IBM_CELL_BLADE=y CONFIG_PPC_IBM_CELL_BLADE=y
CONFIG_UDBG_RTAS_CONSOLE=y CONFIG_UDBG_RTAS_CONSOLE=y
CONFIG_PPC_PS3=y
# CONFIG_U3_DART is not set # CONFIG_U3_DART is not set
CONFIG_PPC_RTAS=y CONFIG_PPC_RTAS=y
# CONFIG_RTAS_ERROR_LOGGING is not set # CONFIG_RTAS_ERROR_LOGGING is not set
...@@ -139,9 +144,23 @@ CONFIG_RTAS_FLASH=y ...@@ -139,9 +144,23 @@ CONFIG_RTAS_FLASH=y
CONFIG_MMIO_NVRAM=y CONFIG_MMIO_NVRAM=y
# CONFIG_PPC_MPC106 is not set # CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set # CONFIG_PPC_970_NAP is not set
# CONFIG_CPU_FREQ is not set CONFIG_PPC_INDIRECT_IO=y
CONFIG_GENERIC_IOMAP=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_DEBUG=y
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
# CONFIG_CPU_FREQ_PMAC64 is not set
# CONFIG_WANT_EARLY_SERIAL is not set # CONFIG_WANT_EARLY_SERIAL is not set
# CONFIG_MPIC is not set CONFIG_MPIC=y
# #
# Cell Broadband Engine options # Cell Broadband Engine options
...@@ -149,6 +168,15 @@ CONFIG_MMIO_NVRAM=y ...@@ -149,6 +168,15 @@ CONFIG_MMIO_NVRAM=y
CONFIG_SPU_FS=m CONFIG_SPU_FS=m
CONFIG_SPU_BASE=y CONFIG_SPU_BASE=y
CONFIG_CBE_RAS=y CONFIG_CBE_RAS=y
CONFIG_CBE_THERM=m
CONFIG_CBE_CPUFREQ=m
#
# PS3 Platform Options
#
CONFIG_PS3_HTAB_SIZE=20
# CONFIG_PS3_DYNAMIC_DMA is not set
CONFIG_PS3_USE_LPAR_ADDR=y
# #
# Kernel options # Kernel options
...@@ -166,13 +194,14 @@ CONFIG_BINFMT_MISC=m ...@@ -166,13 +194,14 @@ CONFIG_BINFMT_MISC=m
CONFIG_FORCE_MAX_ZONEORDER=9 CONFIG_FORCE_MAX_ZONEORDER=9
# CONFIG_IOMMU_VMERGE is not set # CONFIG_IOMMU_VMERGE is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_KEXEC=y # CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set # CONFIG_CRASH_DUMP is not set
CONFIG_IRQ_ALL_CPUS=y CONFIG_IRQ_ALL_CPUS=y
CONFIG_NUMA=y CONFIG_NUMA=y
CONFIG_NODES_SHIFT=4 CONFIG_NODES_SHIFT=4
CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_SELECT_MEMORY_MODEL=y CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set # CONFIG_FLATMEM_MANUAL is not set
...@@ -189,6 +218,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4 ...@@ -189,6 +218,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_MIGRATION=y CONFIG_MIGRATION=y
CONFIG_RESOURCES_64BIT=y CONFIG_RESOURCES_64BIT=y
CONFIG_ARCH_MEMORY_PROBE=y CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_NODES_SPAN_OTHER_NODES=y
CONFIG_PPC_64K_PAGES=y CONFIG_PPC_64K_PAGES=y
CONFIG_SCHED_SMT=y CONFIG_SCHED_SMT=y
CONFIG_PROC_DEVICETREE=y CONFIG_PROC_DEVICETREE=y
...@@ -207,7 +237,6 @@ CONFIG_GENERIC_ISA_DMA=y ...@@ -207,7 +237,6 @@ CONFIG_GENERIC_ISA_DMA=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y CONFIG_PCIEPORTBUS=y
# CONFIG_PCI_MULTITHREAD_PROBE is not set
# CONFIG_PCI_DEBUG is not set # CONFIG_PCI_DEBUG is not set
# #
...@@ -280,7 +309,6 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=y ...@@ -280,7 +309,6 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=y
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
# CONFIG_IPV6_SIT is not set # CONFIG_IPV6_SIT is not set
CONFIG_IPV6_TUNNEL=m CONFIG_IPV6_TUNNEL=m
# CONFIG_IPV6_SUBTREES is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set # CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set # CONFIG_NETWORK_SECMARK is not set
CONFIG_NETFILTER=y CONFIG_NETFILTER=y
...@@ -1107,7 +1135,8 @@ CONFIG_PLIST=y ...@@ -1107,7 +1135,8 @@ CONFIG_PLIST=y
# #
# Instrumentation Support # Instrumentation Support
# #
# CONFIG_PROFILING is not set CONFIG_PROFILING=y
CONFIG_OPROFILE=y
# CONFIG_KPROBES is not set # CONFIG_KPROBES is not set
# #
...@@ -1142,6 +1171,7 @@ CONFIG_DEBUG_FS=y ...@@ -1142,6 +1171,7 @@ CONFIG_DEBUG_FS=y
CONFIG_DEBUGGER=y CONFIG_DEBUGGER=y
CONFIG_XMON=y CONFIG_XMON=y
CONFIG_XMON_DEFAULT=y CONFIG_XMON_DEFAULT=y
CONFIG_XMON_DISASSEMBLY=y
CONFIG_IRQSTACKS=y CONFIG_IRQSTACKS=y
# CONFIG_BOOTX_TEXT is not set # CONFIG_BOOTX_TEXT is not set
# CONFIG_PPC_EARLY_DEBUG is not set # CONFIG_PPC_EARLY_DEBUG is not set
...@@ -1159,7 +1189,7 @@ CONFIG_CRYPTO=y ...@@ -1159,7 +1189,7 @@ CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=m CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH=y
# CONFIG_CRYPTO_MANAGER is not set CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD4 is not set
......
This diff is collapsed.
This diff is collapsed.
...@@ -1386,8 +1386,8 @@ CONFIG_INOTIFY=y ...@@ -1386,8 +1386,8 @@ CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set # CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y CONFIG_DNOTIFY=y
CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set CONFIG_AUTOFS4_FS=m
# CONFIG_FUSE_FS is not set # CONFIG_FUSE_FS is not set
# #
......
This diff is collapsed.
...@@ -17,11 +17,11 @@ obj-y += vdso32/ ...@@ -17,11 +17,11 @@ obj-y += vdso32/
obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
signal_64.o ptrace32.o \ signal_64.o ptrace32.o \
paca.o cpu_setup_ppc970.o \ paca.o cpu_setup_ppc970.o \
firmware.o sysfs.o firmware.o sysfs.o nvram_64.o
obj-$(CONFIG_PPC64) += vdso64/ obj-$(CONFIG_PPC64) += vdso64/
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
obj-$(CONFIG_PPC_970_NAP) += idle_power4.o obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o
procfs-$(CONFIG_PPC64) := proc_ppc64.o procfs-$(CONFIG_PPC64) := proc_ppc64.o
obj-$(CONFIG_PROC_FS) += $(procfs-y) obj-$(CONFIG_PROC_FS) += $(procfs-y)
rtaspci-$(CONFIG_PPC64) := rtas_pci.o rtaspci-$(CONFIG_PPC64) := rtas_pci.o
...@@ -32,7 +32,6 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o ...@@ -32,7 +32,6 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o
obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_IBMEBUS) += ibmebus.o obj-$(CONFIG_IBMEBUS) += ibmebus.o
obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
obj64-$(CONFIG_PPC_MULTIPLATFORM) += nvram_64.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o obj-$(CONFIG_TAU) += tau_6xx.o
...@@ -59,11 +58,11 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o ...@@ -59,11 +58,11 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_KPROBES) += kprobes.o
obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
module-$(CONFIG_PPC64) += module_64.o module-$(CONFIG_PPC64) += module_64.o
obj-$(CONFIG_MODULES) += $(module-y) obj-$(CONFIG_MODULES) += $(module-y)
pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o pci_iommu.o \ pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o
pci_direct_iommu.o iomap.o
pci32-$(CONFIG_PPC32) := pci_32.o pci32-$(CONFIG_PPC32) := pci_32.o
obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y)
kexec-$(CONFIG_PPC64) := machine_kexec_64.o kexec-$(CONFIG_PPC64) := machine_kexec_64.o
...@@ -72,8 +71,12 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y) ...@@ -72,8 +71,12 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y)
obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_AUDIT) += audit.o
obj64-$(CONFIG_AUDIT) += compat_audit.o obj64-$(CONFIG_AUDIT) += compat_audit.o
ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
obj-y += iomap.o
endif
ifeq ($(CONFIG_PPC_ISERIES),y) ifeq ($(CONFIG_PPC_ISERIES),y)
$(obj)/head_64.o: $(obj)/lparmap.s extra-y += lparmap.s
AFLAGS_head_64.o += -I$(obj) AFLAGS_head_64.o += -I$(obj)
endif endif
......
...@@ -118,7 +118,8 @@ int main(void) ...@@ -118,7 +118,8 @@ int main(void)
DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr)); DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1)); DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc)); DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled)); DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled));
DEFINE(PACAHARDIRQEN, offsetof(struct paca_struct, hard_enabled));
DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
......
...@@ -83,6 +83,22 @@ _GLOBAL(__setup_cpu_ppc970) ...@@ -83,6 +83,22 @@ _GLOBAL(__setup_cpu_ppc970)
rldimi r0,r11,52,8 /* set NAP and DPM */ rldimi r0,r11,52,8 /* set NAP and DPM */
li r11,0 li r11,0
rldimi r0,r11,32,31 /* clear EN_ATTN */ rldimi r0,r11,32,31 /* clear EN_ATTN */
b load_hids /* Jump to shared code */
_GLOBAL(__setup_cpu_ppc970MP)
/* Do nothing if not running in HV mode */
mfmsr r0
rldicl. r0,r0,4,63
beqlr
mfspr r0,SPRN_HID0
li r11,0x15 /* clear DOZE and SLEEP */
rldimi r0,r11,52,6 /* set DEEPNAP, NAP and DPM */
li r11,0
rldimi r0,r11,32,31 /* clear EN_ATTN */
load_hids:
mtspr SPRN_HID0,r0 mtspr SPRN_HID0,r0
mfspr r0,SPRN_HID0 mfspr r0,SPRN_HID0
mfspr r0,SPRN_HID0 mfspr r0,SPRN_HID0
......
...@@ -42,6 +42,7 @@ extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec); ...@@ -42,6 +42,7 @@ extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
#endif /* CONFIG_PPC32 */ #endif /* CONFIG_PPC32 */
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
extern void __restore_cpu_ppc970(void); extern void __restore_cpu_ppc970(void);
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
...@@ -222,9 +223,9 @@ static struct cpu_spec cpu_specs[] = { ...@@ -222,9 +223,9 @@ static struct cpu_spec cpu_specs[] = {
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970MP,
.cpu_restore = __restore_cpu_ppc970, .cpu_restore = __restore_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970", .oprofile_cpu_type = "ppc64/970MP",
.oprofile_type = PPC_OPROFILE_POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "ppc970", .platform = "ppc970",
}, },
...@@ -276,10 +277,45 @@ static struct cpu_spec cpu_specs[] = { ...@@ -276,10 +277,45 @@ static struct cpu_spec cpu_specs[] = {
.oprofile_mmcra_sipr = MMCRA_SIPR, .oprofile_mmcra_sipr = MMCRA_SIPR,
.platform = "power5+", .platform = "power5+",
}, },
{ /* POWER6 in P5+ mode; 2.04-compliant processor */
.pvr_mask = 0xffffffff,
.pvr_value = 0x0f000001,
.cpu_name = "POWER5+",
.cpu_features = CPU_FTRS_POWER5,
.cpu_user_features = COMMON_USER_POWER5_PLUS,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.oprofile_cpu_type = "ppc64/power6",
.oprofile_type = PPC_OPROFILE_POWER4,
.oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
.oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
.oprofile_mmcra_clear = POWER6_MMCRA_THRM |
POWER6_MMCRA_OTHER,
.platform = "power5+",
},
{ /* Power6 */ { /* Power6 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
.pvr_value = 0x003e0000, .pvr_value = 0x003e0000,
.cpu_name = "POWER6", .cpu_name = "POWER6 (raw)",
.cpu_features = CPU_FTRS_POWER6,
.cpu_user_features = COMMON_USER_POWER6 |
PPC_FEATURE_POWER6_EXT,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.oprofile_cpu_type = "ppc64/power6",
.oprofile_type = PPC_OPROFILE_POWER4,
.oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
.oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
.oprofile_mmcra_clear = POWER6_MMCRA_THRM |
POWER6_MMCRA_OTHER,
.platform = "power6x",
},
{ /* 2.05-compliant processor, i.e. Power6 "architected" mode */
.pvr_mask = 0xffffffff,
.pvr_value = 0x0f000002,
.cpu_name = "POWER6 (architected)",
.cpu_features = CPU_FTRS_POWER6, .cpu_features = CPU_FTRS_POWER6,
.cpu_user_features = COMMON_USER_POWER6, .cpu_user_features = COMMON_USER_POWER6,
.icache_bsize = 128, .icache_bsize = 128,
...@@ -303,6 +339,9 @@ static struct cpu_spec cpu_specs[] = { ...@@ -303,6 +339,9 @@ static struct cpu_spec cpu_specs[] = {
PPC_FEATURE_SMT, PPC_FEATURE_SMT,
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 4,
.oprofile_cpu_type = "ppc64/cell-be",
.oprofile_type = PPC_OPROFILE_CELL,
.platform = "ppc-cell-be", .platform = "ppc-cell-be",
}, },
{ /* PA Semi PA6T */ { /* PA Semi PA6T */
...@@ -801,6 +840,17 @@ static struct cpu_spec cpu_specs[] = { ...@@ -801,6 +840,17 @@ static struct cpu_spec cpu_specs[] = {
.cpu_setup = __setup_cpu_603, .cpu_setup = __setup_cpu_603,
.platform = "ppc603", .platform = "ppc603",
}, },
{ /* e300c3 on 83xx */
.pvr_mask = 0x7fff0000,
.pvr_value = 0x00850000,
.cpu_name = "e300c3",
.cpu_features = CPU_FTRS_E300,
.cpu_user_features = COMMON_USER,
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_603,
.platform = "ppc603",
},
{ /* default match, we assume split I/D cache & TB (non-601)... */ { /* default match, we assume split I/D cache & TB (non-601)... */
.pvr_mask = 0x00000000, .pvr_mask = 0x00000000,
.pvr_value = 0x00000000, .pvr_value = 0x00000000,
...@@ -1169,19 +1219,15 @@ static struct cpu_spec cpu_specs[] = { ...@@ -1169,19 +1219,15 @@ static struct cpu_spec cpu_specs[] = {
#endif /* CONFIG_PPC32 */ #endif /* CONFIG_PPC32 */
}; };
struct cpu_spec *identify_cpu(unsigned long offset) struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
{ {
struct cpu_spec *s = cpu_specs; struct cpu_spec *s = cpu_specs;
struct cpu_spec **cur = &cur_cpu_spec; struct cpu_spec **cur = &cur_cpu_spec;
unsigned int pvr = mfspr(SPRN_PVR);
int i; int i;
s = PTRRELOC(s); s = PTRRELOC(s);
cur = PTRRELOC(cur); cur = PTRRELOC(cur);
if (*cur != NULL)
return PTRRELOC(*cur);
for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
if ((pvr & s->pvr_mask) == s->pvr_value) { if ((pvr & s->pvr_mask) == s->pvr_value) {
*cur = cpu_specs + i; *cur = cpu_specs + i;
......
...@@ -111,7 +111,7 @@ void crash_ipi_callback(struct pt_regs *regs) ...@@ -111,7 +111,7 @@ void crash_ipi_callback(struct pt_regs *regs)
if (!cpu_online(cpu)) if (!cpu_online(cpu))
return; return;
local_irq_disable(); hard_irq_disable();
if (!cpu_isset(cpu, cpus_in_crash)) if (!cpu_isset(cpu, cpus_in_crash))
crash_save_this_cpu(regs, cpu); crash_save_this_cpu(regs, cpu);
cpu_set(cpu, cpus_in_crash); cpu_set(cpu, cpus_in_crash);
...@@ -289,7 +289,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs) ...@@ -289,7 +289,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
* an SMP system. * an SMP system.
* The kernel is broken so disable interrupts. * The kernel is broken so disable interrupts.
*/ */
local_irq_disable(); hard_irq_disable();
for_each_irq(irq) { for_each_irq(irq) {
struct irq_desc *desc = irq_desc + irq; struct irq_desc *desc = irq_desc + irq;
......
/* /*
* Copyright (C) 2004 IBM Corporation * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corporation
* *
* Implements the generic device dma API for ppc64. Handles * Provide default implementations of the DMA mapping callbacks for
* the pci and vio busses * directly mapped busses and busses using the iommu infrastructure
*/ */
#include <linux/device.h> #include <linux/device.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
/* Include the busses we support */
#include <linux/pci.h>
#include <asm/vio.h>
#include <asm/ibmebus.h>
#include <asm/scatterlist.h>
#include <asm/bug.h> #include <asm/bug.h>
#include <asm/iommu.h>
#include <asm/abs_addr.h>
static struct dma_mapping_ops *get_dma_ops(struct device *dev) /*
{ * Generic iommu implementation
#ifdef CONFIG_PCI */
if (dev->bus == &pci_bus_type)
return &pci_dma_ops;
#endif
#ifdef CONFIG_IBMVIO
if (dev->bus == &vio_bus_type)
return &vio_dma_ops;
#endif
#ifdef CONFIG_IBMEBUS
if (dev->bus == &ibmebus_bus_type)
return &ibmebus_dma_ops;
#endif
return NULL;
}
int dma_supported(struct device *dev, u64 mask) static inline unsigned long device_to_mask(struct device *dev)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); if (dev->dma_mask && *dev->dma_mask)
return *dev->dma_mask;
/* Assume devices without mask can take 32 bit addresses */
return 0xfffffffful;
}
BUG_ON(!dma_ops);
return dma_ops->dma_supported(dev, mask); /* Allocates a contiguous real buffer and creates mappings over it.
* Returns the virtual address of the buffer and sets dma_handle
* to the dma address (mapping) of the first page.
*/
static void *dma_iommu_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
return iommu_alloc_coherent(dev->archdata.dma_data, size, dma_handle,
device_to_mask(dev), flag,
dev->archdata.numa_node);
} }
EXPORT_SYMBOL(dma_supported);
int dma_set_mask(struct device *dev, u64 dma_mask) static void dma_iommu_free_coherent(struct device *dev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{ {
#ifdef CONFIG_PCI iommu_free_coherent(dev->archdata.dma_data, size, vaddr, dma_handle);
if (dev->bus == &pci_bus_type)
return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
#endif
#ifdef CONFIG_IBMVIO
if (dev->bus == &vio_bus_type)
return -EIO;
#endif /* CONFIG_IBMVIO */
#ifdef CONFIG_IBMEBUS
if (dev->bus == &ibmebus_bus_type)
return -EIO;
#endif
BUG();
return 0;
} }
EXPORT_SYMBOL(dma_set_mask);
void *dma_alloc_coherent(struct device *dev, size_t size, /* Creates TCEs for a user provided buffer. The user buffer must be
dma_addr_t *dma_handle, gfp_t flag) * contiguous real kernel storage (not vmalloc). The address of the buffer
* passed here is the kernel (virtual) address of the buffer. The buffer
* need not be page aligned, the dma_addr_t returned will point to the same
* byte within the page as vaddr.
*/
static dma_addr_t dma_iommu_map_single(struct device *dev, void *vaddr,
size_t size,
enum dma_data_direction direction)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); return iommu_map_single(dev->archdata.dma_data, vaddr, size,
device_to_mask(dev), direction);
BUG_ON(!dma_ops);
return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
} }
EXPORT_SYMBOL(dma_alloc_coherent);
void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
dma_addr_t dma_handle) static void dma_iommu_unmap_single(struct device *dev, dma_addr_t dma_handle,
size_t size,
enum dma_data_direction direction)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); iommu_unmap_single(dev->archdata.dma_data, dma_handle, size, direction);
}
BUG_ON(!dma_ops);
dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); static int dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist,
int nelems, enum dma_data_direction direction)
{
return iommu_map_sg(dev->archdata.dma_data, sglist, nelems,
device_to_mask(dev), direction);
} }
EXPORT_SYMBOL(dma_free_coherent);
dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist,
enum dma_data_direction direction) int nelems, enum dma_data_direction direction)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); iommu_unmap_sg(dev->archdata.dma_data, sglist, nelems, direction);
BUG_ON(!dma_ops);
return dma_ops->map_single(dev, cpu_addr, size, direction);
} }
EXPORT_SYMBOL(dma_map_single);
void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, /* We support DMA to/from any memory page via the iommu */
enum dma_data_direction direction) static int dma_iommu_dma_supported(struct device *dev, u64 mask)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); struct iommu_table *tbl = dev->archdata.dma_data;
BUG_ON(!dma_ops); if (!tbl || tbl->it_offset > mask) {
printk(KERN_INFO
dma_ops->unmap_single(dev, dma_addr, size, direction); "Warning: IOMMU offset too big for device mask\n");
if (tbl)
printk(KERN_INFO
"mask: 0x%08lx, table offset: 0x%08lx\n",
mask, tbl->it_offset);
else
printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",
mask);
return 0;
} else
return 1;
} }
EXPORT_SYMBOL(dma_unmap_single);
dma_addr_t dma_map_page(struct device *dev, struct page *page, struct dma_mapping_ops dma_iommu_ops = {
unsigned long offset, size_t size, .alloc_coherent = dma_iommu_alloc_coherent,
enum dma_data_direction direction) .free_coherent = dma_iommu_free_coherent,
{ .map_single = dma_iommu_map_single,
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); .unmap_single = dma_iommu_unmap_single,
.map_sg = dma_iommu_map_sg,
.unmap_sg = dma_iommu_unmap_sg,
.dma_supported = dma_iommu_dma_supported,
};
EXPORT_SYMBOL(dma_iommu_ops);
BUG_ON(!dma_ops); /*
* Generic direct DMA implementation
*
* This implementation supports a global offset that can be applied if
* the address at which memory is visible to devices is not 0.
*/
unsigned long dma_direct_offset;
return dma_ops->map_single(dev, page_address(page) + offset, size, static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
direction); dma_addr_t *dma_handle, gfp_t flag)
{
struct page *page;
void *ret;
int node = dev->archdata.numa_node;
/* TODO: Maybe use the numa node here too ? */
page = alloc_pages_node(node, flag, get_order(size));
if (page == NULL)
return NULL;
ret = page_address(page);
memset(ret, 0, size);
*dma_handle = virt_to_abs(ret) | dma_direct_offset;
return ret;
} }
EXPORT_SYMBOL(dma_map_page);
void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, static void dma_direct_free_coherent(struct device *dev, size_t size,
enum dma_data_direction direction) void *vaddr, dma_addr_t dma_handle)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); free_pages((unsigned long)vaddr, get_order(size));
}
BUG_ON(!dma_ops); static dma_addr_t dma_direct_map_single(struct device *dev, void *ptr,
size_t size,
enum dma_data_direction direction)
{
return virt_to_abs(ptr) | dma_direct_offset;
}
dma_ops->unmap_single(dev, dma_address, size, direction); static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr,
size_t size,
enum dma_data_direction direction)
{
} }
EXPORT_SYMBOL(dma_unmap_page);
int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, static int dma_direct_map_sg(struct device *dev, struct scatterlist *sg,
enum dma_data_direction direction) int nents, enum dma_data_direction direction)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); int i;
BUG_ON(!dma_ops); for (i = 0; i < nents; i++, sg++) {
sg->dma_address = (page_to_phys(sg->page) + sg->offset) |
dma_direct_offset;
sg->dma_length = sg->length;
}
return dma_ops->map_sg(dev, sg, nents, direction); return nents;
} }
EXPORT_SYMBOL(dma_map_sg);
void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, static void dma_direct_unmap_sg(struct device *dev, struct scatterlist *sg,
enum dma_data_direction direction) int nents, enum dma_data_direction direction)
{ {
struct dma_mapping_ops *dma_ops = get_dma_ops(dev); }
BUG_ON(!dma_ops);
dma_ops->unmap_sg(dev, sg, nhwentries, direction); static int dma_direct_dma_supported(struct device *dev, u64 mask)
{
/* Could be improved to check for memory though it better be
* done via some global so platforms can set the limit in case
* they have limited DMA windows
*/
return mask >= DMA_32BIT_MASK;
} }
EXPORT_SYMBOL(dma_unmap_sg);
struct dma_mapping_ops dma_direct_ops = {
.alloc_coherent = dma_direct_alloc_coherent,
.free_coherent = dma_direct_free_coherent,
.map_single = dma_direct_map_single,
.unmap_single = dma_direct_unmap_single,
.map_sg = dma_direct_map_sg,
.unmap_sg = dma_direct_unmap_sg,
.dma_supported = dma_direct_dma_supported,
};
EXPORT_SYMBOL(dma_direct_ops);
This diff is collapsed.
This diff is collapsed.
...@@ -112,7 +112,7 @@ static int ibmebus_dma_supported(struct device *dev, u64 mask) ...@@ -112,7 +112,7 @@ static int ibmebus_dma_supported(struct device *dev, u64 mask)
return 1; return 1;
} }
struct dma_mapping_ops ibmebus_dma_ops = { static struct dma_mapping_ops ibmebus_dma_ops = {
.alloc_coherent = ibmebus_alloc_coherent, .alloc_coherent = ibmebus_alloc_coherent,
.free_coherent = ibmebus_free_coherent, .free_coherent = ibmebus_free_coherent,
.map_single = ibmebus_map_single, .map_single = ibmebus_map_single,
...@@ -176,6 +176,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_common( ...@@ -176,6 +176,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_common(
dev->ofdev.dev.bus = &ibmebus_bus_type; dev->ofdev.dev.bus = &ibmebus_bus_type;
dev->ofdev.dev.release = ibmebus_dev_release; dev->ofdev.dev.release = ibmebus_dev_release;
dev->ofdev.dev.archdata.of_node = dev->ofdev.node;
dev->ofdev.dev.archdata.dma_ops = &ibmebus_dma_ops;
dev->ofdev.dev.archdata.numa_node = of_node_to_nid(dev->ofdev.node);
/* An ibmebusdev is based on a of_device. We have to change the /* An ibmebusdev is based on a of_device. We have to change the
* bus type to use our own DMA mapping operations. * bus type to use our own DMA mapping operations.
*/ */
...@@ -210,11 +214,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node( ...@@ -210,11 +214,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node(
return NULL; return NULL;
} }
dev = kmalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL);
if (!dev) { if (!dev) {
return NULL; return NULL;
} }
memset(dev, 0, sizeof(struct ibmebus_dev));
dev->ofdev.node = of_node_get(dn); dev->ofdev.node = of_node_get(dn);
......
...@@ -39,6 +39,13 @@ ...@@ -39,6 +39,13 @@
#define cpu_should_die() 0 #define cpu_should_die() 0
#endif #endif
static int __init powersave_off(char *arg)
{
ppc_md.power_save = NULL;
return 0;
}
__setup("powersave=off", powersave_off);
/* /*
* The body of the idle task. * The body of the idle task.
*/ */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment