mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
powerpc: Remove arch/ppc and include/asm-ppc
All the maintained platforms are now in arch/powerpc, so the old arch/ppc stuff can now go away. Acked-by: Adrian Bunk <bunk@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Becky Bruce <becky.bruce@freescale.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Jochen Friedrich <jochen@scram.de> Acked-by: John Linn <john.linn@xilinx.com> Acked-by: Jon Loeliger <jdl@freescale.com> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: Scott Wood <scottwood@freescale.com> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
1
arch/ppc/.gitignore
vendored
1
arch/ppc/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/include
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# Makefile for the linux MPC4xx ppc-specific parts
|
||||
#
|
||||
|
||||
|
||||
obj-$(CONFIG_SERIAL_SICC) += serial_sicc.o
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,65 +0,0 @@
|
||||
#
|
||||
# CPM2 Communication options
|
||||
#
|
||||
|
||||
menu "CPM2 Options"
|
||||
depends on CPM2
|
||||
|
||||
config SCC_ENET
|
||||
bool "CPM SCC Ethernet"
|
||||
depends on NET_ETHERNET
|
||||
|
||||
#
|
||||
# CONFIG_FEC_ENET is only used to get netdevices to call our init
|
||||
# function. Any combination of FCC1,2,3 are supported.
|
||||
#
|
||||
config FEC_ENET
|
||||
bool "FCC Ethernet"
|
||||
depends on NET_ETHERNET
|
||||
|
||||
config FCC1_ENET
|
||||
bool "Ethernet on FCC1"
|
||||
depends on FEC_ENET
|
||||
help
|
||||
Use CPM2 fast Ethernet controller 1 to drive Ethernet (default).
|
||||
|
||||
config FCC2_ENET
|
||||
bool "Ethernet on FCC2"
|
||||
depends on FEC_ENET
|
||||
help
|
||||
Use CPM2 fast Ethernet controller 2 to drive Ethernet.
|
||||
|
||||
config FCC3_ENET
|
||||
bool "Ethernet on FCC3"
|
||||
depends on FEC_ENET
|
||||
help
|
||||
Use CPM2 fast Ethernet controller 3 to drive Ethernet.
|
||||
|
||||
config USE_MDIO
|
||||
bool "Use MDIO for PHY configuration"
|
||||
depends on FEC_ENET
|
||||
|
||||
choice
|
||||
prompt "Type of PHY"
|
||||
depends on 8260 && USE_MDIO
|
||||
default FCC_GENERIC_PHY
|
||||
|
||||
config FCC_LXT970
|
||||
bool "LXT970"
|
||||
|
||||
config FCC_LXT971
|
||||
bool "LXT971"
|
||||
|
||||
config FCC_QS6612
|
||||
bool "QS6612"
|
||||
|
||||
config FCC_DM9131
|
||||
bool "DM9131"
|
||||
|
||||
config FCC_DM9161
|
||||
bool "DM9161"
|
||||
|
||||
config FCC_GENERIC_PHY
|
||||
bool "Generic"
|
||||
endchoice
|
||||
endmenu
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# Makefile for the linux ppc-specific parts of comm processor (v2)
|
||||
#
|
||||
|
||||
obj-$(CONFIG_FEC_ENET) += fcc_enet.o
|
||||
obj-$(CONFIG_SCC_ENET) += enet.o
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,134 +0,0 @@
|
||||
#
|
||||
# MPC8xx Communication options
|
||||
#
|
||||
|
||||
menu "MPC8xx CPM Options"
|
||||
depends on 8xx
|
||||
|
||||
config SCC_ENET
|
||||
bool "CPM SCC Ethernet"
|
||||
depends on NET_ETHERNET
|
||||
help
|
||||
Enable Ethernet support via the Motorola MPC8xx serial
|
||||
communications controller.
|
||||
|
||||
choice
|
||||
prompt "SCC used for Ethernet"
|
||||
depends on SCC_ENET
|
||||
default SCC1_ENET
|
||||
|
||||
config SCC1_ENET
|
||||
bool "SCC1"
|
||||
help
|
||||
Use MPC8xx serial communications controller 1 to drive Ethernet
|
||||
(default).
|
||||
|
||||
config SCC2_ENET
|
||||
bool "SCC2"
|
||||
help
|
||||
Use MPC8xx serial communications controller 2 to drive Ethernet.
|
||||
|
||||
config SCC3_ENET
|
||||
bool "SCC3"
|
||||
help
|
||||
Use MPC8xx serial communications controller 3 to drive Ethernet.
|
||||
|
||||
endchoice
|
||||
|
||||
config FEC_ENET
|
||||
bool "860T FEC Ethernet"
|
||||
depends on NET_ETHERNET
|
||||
help
|
||||
Enable Ethernet support via the Fast Ethernet Controller (FCC) on
|
||||
the Motorola MPC8260.
|
||||
|
||||
config USE_MDIO
|
||||
bool "Use MDIO for PHY configuration"
|
||||
depends on FEC_ENET
|
||||
help
|
||||
On some boards the hardware configuration of the ethernet PHY can be
|
||||
used without any software interaction over the MDIO interface, so
|
||||
all MII code can be omitted. Say N here if unsure or if you don't
|
||||
need link status reports.
|
||||
|
||||
config FEC_AM79C874
|
||||
bool "Support AMD79C874 PHY"
|
||||
depends on USE_MDIO
|
||||
|
||||
config FEC_LXT970
|
||||
bool "Support LXT970 PHY"
|
||||
depends on USE_MDIO
|
||||
|
||||
config FEC_LXT971
|
||||
bool "Support LXT971 PHY"
|
||||
depends on USE_MDIO
|
||||
|
||||
config FEC_QS6612
|
||||
bool "Support QS6612 PHY"
|
||||
depends on USE_MDIO
|
||||
|
||||
config ENET_BIG_BUFFERS
|
||||
bool "Use Big CPM Ethernet Buffers"
|
||||
depends on SCC_ENET || FEC_ENET
|
||||
help
|
||||
Allocate large buffers for MPC8xx Ethernet. Increases throughput
|
||||
and decreases the likelihood of dropped packets, but costs memory.
|
||||
|
||||
# This doesn't really belong here, but it is convenient to ask
|
||||
# 8xx specific questions.
|
||||
comment "Generic MPC8xx Options"
|
||||
|
||||
config 8xx_COPYBACK
|
||||
bool "Copy-Back Data Cache (else Writethrough)"
|
||||
help
|
||||
Saying Y here will cause the cache on an MPC8xx processor to be used
|
||||
in Copy-Back mode. If you say N here, it is used in Writethrough
|
||||
mode.
|
||||
|
||||
If in doubt, say Y here.
|
||||
|
||||
config 8xx_CPU6
|
||||
bool "CPU6 Silicon Errata (860 Pre Rev. C)"
|
||||
help
|
||||
MPC860 CPUs, prior to Rev C have some bugs in the silicon, which
|
||||
require workarounds for Linux (and most other OSes to work). If you
|
||||
get a BUG() very early in boot, this might fix the problem. For
|
||||
more details read the document entitled "MPC860 Family Device Errata
|
||||
Reference" on Motorola's website. This option also incurs a
|
||||
performance hit.
|
||||
|
||||
If in doubt, say N here.
|
||||
|
||||
choice
|
||||
prompt "Microcode patch selection"
|
||||
default NO_UCODE_PATCH
|
||||
help
|
||||
Help not implemented yet, coming soon.
|
||||
|
||||
config NO_UCODE_PATCH
|
||||
bool "None"
|
||||
|
||||
config USB_SOF_UCODE_PATCH
|
||||
bool "USB SOF patch"
|
||||
help
|
||||
Help not implemented yet, coming soon.
|
||||
|
||||
config I2C_SPI_UCODE_PATCH
|
||||
bool "I2C/SPI relocation patch"
|
||||
help
|
||||
Help not implemented yet, coming soon.
|
||||
|
||||
config I2C_SPI_SMC1_UCODE_PATCH
|
||||
bool "I2C/SPI/SMC1 relocation patch"
|
||||
help
|
||||
Help not implemented yet, coming soon.
|
||||
|
||||
endchoice
|
||||
|
||||
config UCODE_PATCH
|
||||
bool
|
||||
default y
|
||||
depends on !NO_UCODE_PATCH
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# Makefile for the linux MPC8xx ppc-specific parts of comm processor
|
||||
#
|
||||
|
||||
obj-y := commproc.o
|
||||
|
||||
obj-$(CONFIG_FEC_ENET) += fec.o
|
||||
obj-$(CONFIG_SCC_ENET) += enet.o
|
||||
obj-$(CONFIG_UCODE_PATCH) += micropatch.o
|
||||
@@ -1,432 +0,0 @@
|
||||
/*
|
||||
* General Purpose functions for the global management of the
|
||||
* Communication Processor Module.
|
||||
* Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
|
||||
*
|
||||
* In addition to the individual control of the communication
|
||||
* channels, there are a few functions that globally affect the
|
||||
* communication processor.
|
||||
*
|
||||
* Buffer descriptors must be allocated from the dual ported memory
|
||||
* space. The allocator for that is here. When the communication
|
||||
* process is reset, we reclaim the memory available. There is
|
||||
* currently no deallocator for this memory.
|
||||
* The amount of space available is platform dependent. On the
|
||||
* MBX, the EPPC software loads additional microcode into the
|
||||
* communication processor, and uses some of the DP ram for this
|
||||
* purpose. Current, the first 512 bytes and the last 256 bytes of
|
||||
* memory are used. Right now I am conservative and only use the
|
||||
* memory that can never be used for microcode. If there are
|
||||
* applications that require more DP ram, we can expand the boundaries
|
||||
* but then we have to be careful of any downloaded microcode.
|
||||
*/
|
||||
#include <linux/errno.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/param.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/module.h>
|
||||
#include <asm/mpc8xx.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/8xx_immap.h>
|
||||
#include <asm/cpm1.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/tlbflush.h>
|
||||
#include <asm/rheap.h>
|
||||
|
||||
#define immr_map(member) \
|
||||
({ \
|
||||
u32 offset = offsetof(immap_t, member); \
|
||||
void *addr = ioremap (IMAP_ADDR + offset, \
|
||||
FIELD_SIZEOF(immap_t, member)); \
|
||||
addr; \
|
||||
})
|
||||
|
||||
#define immr_map_size(member, size) \
|
||||
({ \
|
||||
u32 offset = offsetof(immap_t, member); \
|
||||
void *addr = ioremap (IMAP_ADDR + offset, size); \
|
||||
addr; \
|
||||
})
|
||||
|
||||
static void m8xx_cpm_dpinit(void);
|
||||
cpm8xx_t *cpmp; /* Pointer to comm processor space */
|
||||
|
||||
/* CPM interrupt vector functions.
|
||||
*/
|
||||
struct cpm_action {
|
||||
void (*handler)(void *);
|
||||
void *dev_id;
|
||||
};
|
||||
static struct cpm_action cpm_vecs[CPMVEC_NR];
|
||||
static irqreturn_t cpm_interrupt(int irq, void * dev);
|
||||
static irqreturn_t cpm_error_interrupt(int irq, void *dev);
|
||||
/* Define a table of names to identify CPM interrupt handlers in
|
||||
* /proc/interrupts.
|
||||
*/
|
||||
const char *cpm_int_name[] =
|
||||
{ "error", "PC4", "PC5", "SMC2",
|
||||
"SMC1", "SPI", "PC6", "Timer 4",
|
||||
"", "PC7", "PC8", "PC9",
|
||||
"Timer 3", "", "PC10", "PC11",
|
||||
"I2C", "RISC Timer", "Timer 2", "",
|
||||
"IDMA2", "IDMA1", "SDMA error", "PC12",
|
||||
"PC13", "Timer 1", "PC14", "SCC4",
|
||||
"SCC3", "SCC2", "SCC1", "PC15"
|
||||
};
|
||||
|
||||
static void
|
||||
cpm_mask_irq(unsigned int irq)
|
||||
{
|
||||
int cpm_vec = irq - CPM_IRQ_OFFSET;
|
||||
|
||||
clrbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
|
||||
}
|
||||
|
||||
static void
|
||||
cpm_unmask_irq(unsigned int irq)
|
||||
{
|
||||
int cpm_vec = irq - CPM_IRQ_OFFSET;
|
||||
|
||||
setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
|
||||
}
|
||||
|
||||
static void
|
||||
cpm_ack(unsigned int irq)
|
||||
{
|
||||
/* We do not need to do anything here. */
|
||||
}
|
||||
|
||||
static void
|
||||
cpm_eoi(unsigned int irq)
|
||||
{
|
||||
int cpm_vec = irq - CPM_IRQ_OFFSET;
|
||||
|
||||
out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr, (1 << cpm_vec));
|
||||
}
|
||||
|
||||
struct hw_interrupt_type cpm_pic = {
|
||||
.typename = " CPM ",
|
||||
.enable = cpm_unmask_irq,
|
||||
.disable = cpm_mask_irq,
|
||||
.ack = cpm_ack,
|
||||
.end = cpm_eoi,
|
||||
};
|
||||
|
||||
void
|
||||
m8xx_cpm_reset(void)
|
||||
{
|
||||
volatile immap_t *imp;
|
||||
volatile cpm8xx_t *commproc;
|
||||
|
||||
imp = (immap_t *)IMAP_ADDR;
|
||||
commproc = (cpm8xx_t *)&imp->im_cpm;
|
||||
|
||||
#ifdef CONFIG_UCODE_PATCH
|
||||
/* Perform a reset.
|
||||
*/
|
||||
commproc->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG);
|
||||
|
||||
/* Wait for it.
|
||||
*/
|
||||
while (commproc->cp_cpcr & CPM_CR_FLG);
|
||||
|
||||
cpm_load_patch(imp);
|
||||
#endif
|
||||
|
||||
/* Set SDMA Bus Request priority 5.
|
||||
* On 860T, this also enables FEC priority 6. I am not sure
|
||||
* this is what we really want for some applications, but the
|
||||
* manual recommends it.
|
||||
* Bit 25, FAM can also be set to use FEC aggressive mode (860T).
|
||||
*/
|
||||
out_be32(&imp->im_siu_conf.sc_sdcr, 1),
|
||||
|
||||
/* Reclaim the DP memory for our use. */
|
||||
m8xx_cpm_dpinit();
|
||||
|
||||
/* Tell everyone where the comm processor resides.
|
||||
*/
|
||||
cpmp = (cpm8xx_t *)commproc;
|
||||
}
|
||||
|
||||
/* This is called during init_IRQ. We used to do it above, but this
|
||||
* was too early since init_IRQ was not yet called.
|
||||
*/
|
||||
static struct irqaction cpm_error_irqaction = {
|
||||
.handler = cpm_error_interrupt,
|
||||
.mask = CPU_MASK_NONE,
|
||||
};
|
||||
static struct irqaction cpm_interrupt_irqaction = {
|
||||
.handler = cpm_interrupt,
|
||||
.mask = CPU_MASK_NONE,
|
||||
.name = "CPM cascade",
|
||||
};
|
||||
|
||||
void
|
||||
cpm_interrupt_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Initialize the CPM interrupt controller.
|
||||
*/
|
||||
out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr,
|
||||
(CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) |
|
||||
((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK);
|
||||
out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, 0);
|
||||
|
||||
/* install the CPM interrupt controller routines for the CPM
|
||||
* interrupt vectors
|
||||
*/
|
||||
for ( i = CPM_IRQ_OFFSET ; i < CPM_IRQ_OFFSET + NR_CPM_INTS ; i++ )
|
||||
irq_desc[i].chip = &cpm_pic;
|
||||
|
||||
/* Set our interrupt handler with the core CPU. */
|
||||
if (setup_irq(CPM_INTERRUPT, &cpm_interrupt_irqaction))
|
||||
panic("Could not allocate CPM IRQ!");
|
||||
|
||||
/* Install our own error handler. */
|
||||
cpm_error_irqaction.name = cpm_int_name[CPMVEC_ERROR];
|
||||
if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction))
|
||||
panic("Could not allocate CPM error IRQ!");
|
||||
|
||||
setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, CICR_IEN);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the CPM interrupt vector.
|
||||
*/
|
||||
int
|
||||
cpm_get_irq(void)
|
||||
{
|
||||
int cpm_vec;
|
||||
|
||||
/* Get the vector by setting the ACK bit and then reading
|
||||
* the register.
|
||||
*/
|
||||
out_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr, 1);
|
||||
cpm_vec = in_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr);
|
||||
cpm_vec >>= 11;
|
||||
|
||||
return cpm_vec;
|
||||
}
|
||||
|
||||
/* CPM interrupt controller cascade interrupt.
|
||||
*/
|
||||
static irqreturn_t
|
||||
cpm_interrupt(int irq, void * dev)
|
||||
{
|
||||
/* This interrupt handler never actually gets called. It is
|
||||
* installed only to unmask the CPM cascade interrupt in the SIU
|
||||
* and to make the CPM cascade interrupt visible in /proc/interrupts.
|
||||
*/
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/* The CPM can generate the error interrupt when there is a race condition
|
||||
* between generating and masking interrupts. All we have to do is ACK it
|
||||
* and return. This is a no-op function so we don't need any special
|
||||
* tests in the interrupt handler.
|
||||
*/
|
||||
static irqreturn_t
|
||||
cpm_error_interrupt(int irq, void *dev)
|
||||
{
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/* A helper function to translate the handler prototype required by
|
||||
* request_irq() to the handler prototype required by cpm_install_handler().
|
||||
*/
|
||||
static irqreturn_t
|
||||
cpm_handler_helper(int irq, void *dev_id)
|
||||
{
|
||||
int cpm_vec = irq - CPM_IRQ_OFFSET;
|
||||
|
||||
(*cpm_vecs[cpm_vec].handler)(dev_id);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/* Install a CPM interrupt handler.
|
||||
* This routine accepts a CPM interrupt vector in the range 0 to 31.
|
||||
* This routine is retained for backward compatibility. Rather than using
|
||||
* this routine to install a CPM interrupt handler, you can now use
|
||||
* request_irq() with an IRQ in the range CPM_IRQ_OFFSET to
|
||||
* CPM_IRQ_OFFSET + NR_CPM_INTS - 1 (16 to 47).
|
||||
*
|
||||
* Notice that the prototype of the interrupt handler function must be
|
||||
* different depending on whether you install the handler with
|
||||
* request_irq() or cpm_install_handler().
|
||||
*/
|
||||
void
|
||||
cpm_install_handler(int cpm_vec, void (*handler)(void *), void *dev_id)
|
||||
{
|
||||
int err;
|
||||
|
||||
/* If null handler, assume we are trying to free the IRQ.
|
||||
*/
|
||||
if (!handler) {
|
||||
free_irq(CPM_IRQ_OFFSET + cpm_vec, dev_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cpm_vecs[cpm_vec].handler != 0)
|
||||
printk(KERN_INFO "CPM interrupt %x replacing %x\n",
|
||||
(uint)handler, (uint)cpm_vecs[cpm_vec].handler);
|
||||
cpm_vecs[cpm_vec].handler = handler;
|
||||
cpm_vecs[cpm_vec].dev_id = dev_id;
|
||||
|
||||
if ((err = request_irq(CPM_IRQ_OFFSET + cpm_vec, cpm_handler_helper,
|
||||
0, cpm_int_name[cpm_vec], dev_id)))
|
||||
printk(KERN_ERR "request_irq() returned %d for CPM vector %d\n",
|
||||
err, cpm_vec);
|
||||
}
|
||||
|
||||
/* Free a CPM interrupt handler.
|
||||
* This routine accepts a CPM interrupt vector in the range 0 to 31.
|
||||
* This routine is retained for backward compatibility.
|
||||
*/
|
||||
void
|
||||
cpm_free_handler(int cpm_vec)
|
||||
{
|
||||
request_irq(CPM_IRQ_OFFSET + cpm_vec, NULL, 0, 0,
|
||||
cpm_vecs[cpm_vec].dev_id);
|
||||
|
||||
cpm_vecs[cpm_vec].handler = NULL;
|
||||
cpm_vecs[cpm_vec].dev_id = NULL;
|
||||
}
|
||||
|
||||
/* Set a baud rate generator. This needs lots of work. There are
|
||||
* four BRGs, any of which can be wired to any channel.
|
||||
* The internal baud rate clock is the system clock divided by 16.
|
||||
* This assumes the baudrate is 16x oversampled by the uart.
|
||||
*/
|
||||
#define BRG_INT_CLK (((bd_t *)__res)->bi_intfreq)
|
||||
#define BRG_UART_CLK (BRG_INT_CLK/16)
|
||||
#define BRG_UART_CLK_DIV16 (BRG_UART_CLK/16)
|
||||
|
||||
void
|
||||
cpm_setbrg(uint brg, uint rate)
|
||||
{
|
||||
volatile uint *bp;
|
||||
|
||||
/* This is good enough to get SMCs running.....
|
||||
*/
|
||||
bp = (uint *)&cpmp->cp_brgc1;
|
||||
bp += brg;
|
||||
/* The BRG has a 12-bit counter. For really slow baud rates (or
|
||||
* really fast processors), we may have to further divide by 16.
|
||||
*/
|
||||
if (((BRG_UART_CLK / rate) - 1) < 4096)
|
||||
*bp = (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN;
|
||||
else
|
||||
*bp = (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
|
||||
CPM_BRG_EN | CPM_BRG_DIV16;
|
||||
}
|
||||
|
||||
/*
|
||||
* dpalloc / dpfree bits.
|
||||
*/
|
||||
static spinlock_t cpm_dpmem_lock;
|
||||
/*
|
||||
* 16 blocks should be enough to satisfy all requests
|
||||
* until the memory subsystem goes up...
|
||||
*/
|
||||
static rh_block_t cpm_boot_dpmem_rh_block[16];
|
||||
static rh_info_t cpm_dpmem_info;
|
||||
|
||||
#define CPM_DPMEM_ALIGNMENT 8
|
||||
static u8* dpram_vbase;
|
||||
static uint dpram_pbase;
|
||||
|
||||
void m8xx_cpm_dpinit(void)
|
||||
{
|
||||
spin_lock_init(&cpm_dpmem_lock);
|
||||
|
||||
dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
|
||||
dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;
|
||||
|
||||
/* Initialize the info header */
|
||||
rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
|
||||
sizeof(cpm_boot_dpmem_rh_block) /
|
||||
sizeof(cpm_boot_dpmem_rh_block[0]),
|
||||
cpm_boot_dpmem_rh_block);
|
||||
|
||||
/*
|
||||
* Attach the usable dpmem area.
|
||||
* XXX: This is actually crap. CPM_DATAONLY_BASE and
|
||||
* CPM_DATAONLY_SIZE are a subset of the available dparm. It varies
|
||||
* with the processor and the microcode patches applied / activated.
|
||||
* But the following should be at least safe.
|
||||
*/
|
||||
rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the requested size worth of DP memory.
|
||||
* This function returns an offset into the DPRAM area.
|
||||
* Use cpm_dpram_addr() to get the virtual address of the area.
|
||||
*/
|
||||
unsigned long cpm_dpalloc(uint size, uint align)
|
||||
{
|
||||
unsigned long start;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&cpm_dpmem_lock, flags);
|
||||
cpm_dpmem_info.alignment = align;
|
||||
start = rh_alloc(&cpm_dpmem_info, size, "commproc");
|
||||
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
|
||||
|
||||
return start;
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpalloc);
|
||||
|
||||
int cpm_dpfree(unsigned long offset)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&cpm_dpmem_lock, flags);
|
||||
ret = rh_free(&cpm_dpmem_info, offset);
|
||||
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpfree);
|
||||
|
||||
unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
|
||||
{
|
||||
unsigned long start;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&cpm_dpmem_lock, flags);
|
||||
cpm_dpmem_info.alignment = align;
|
||||
start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
|
||||
spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
|
||||
|
||||
return start;
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpalloc_fixed);
|
||||
|
||||
void cpm_dpdump(void)
|
||||
{
|
||||
rh_dump(&cpm_dpmem_info);
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpdump);
|
||||
|
||||
void *cpm_dpram_addr(unsigned long offset)
|
||||
{
|
||||
return (void *)(dpram_vbase + offset);
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpram_addr);
|
||||
|
||||
uint cpm_dpram_phys(u8* addr)
|
||||
{
|
||||
return (dpram_pbase + (uint)(addr - dpram_vbase));
|
||||
}
|
||||
EXPORT_SYMBOL(cpm_dpram_phys);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1186
arch/ppc/Kconfig
1186
arch/ppc/Kconfig
File diff suppressed because it is too large
Load Diff
@@ -1,66 +0,0 @@
|
||||
menu "Kernel hacking"
|
||||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
config KGDB
|
||||
bool "Include kgdb kernel debugger"
|
||||
depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx)
|
||||
select DEBUG_INFO
|
||||
help
|
||||
Include in-kernel hooks for kgdb, the Linux kernel source level
|
||||
debugger. See <http://kgdb.sourceforge.net/> for more information.
|
||||
Unless you are intending to debug the kernel, say N here.
|
||||
|
||||
choice
|
||||
prompt "Serial Port"
|
||||
depends on KGDB
|
||||
default KGDB_TTYS1
|
||||
|
||||
config KGDB_TTYS0
|
||||
bool "ttyS0"
|
||||
|
||||
config KGDB_TTYS1
|
||||
bool "ttyS1"
|
||||
|
||||
config KGDB_TTYS2
|
||||
bool "ttyS2"
|
||||
|
||||
config KGDB_TTYS3
|
||||
bool "ttyS3"
|
||||
|
||||
endchoice
|
||||
|
||||
config KGDB_CONSOLE
|
||||
bool "Enable serial console thru kgdb port"
|
||||
depends on KGDB && 8xx || CPM2
|
||||
help
|
||||
If you enable this, all serial console messages will be sent
|
||||
over the gdb stub.
|
||||
If unsure, say N.
|
||||
|
||||
config XMON
|
||||
bool "Include xmon kernel debugger"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Include in-kernel hooks for the xmon kernel monitor/debugger.
|
||||
Unless you are intending to debug the kernel, say N here.
|
||||
|
||||
config BDI_SWITCH
|
||||
bool "Include BDI-2000 user context switcher"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Include in-kernel support for the Abatron BDI2000 debugger.
|
||||
Unless you are intending to debug the kernel with one of these
|
||||
machines, say N here.
|
||||
|
||||
config SERIAL_TEXT_DEBUG
|
||||
bool "Support for early boot texts over serial port"
|
||||
depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
|
||||
PPC_GEN550 || PPC_MPC52xx
|
||||
|
||||
config PPC_OCP
|
||||
bool
|
||||
depends on IBM_OCP
|
||||
default y
|
||||
|
||||
endmenu
|
||||
@@ -1,135 +0,0 @@
|
||||
# This file is included by the global makefile so that you can add your own
|
||||
# architecture-specific flags and dependencies.
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 1994 by Linus Torvalds
|
||||
# Changes for PPC by Gary Thomas
|
||||
# Rewritten by Cort Dougan and Paul Mackerras
|
||||
#
|
||||
|
||||
# This must match PAGE_OFFSET in include/asm-ppc/page.h.
|
||||
KERNELLOAD := $(CONFIG_KERNEL_START)
|
||||
|
||||
HAS_BIARCH := $(call cc-option-yn, -m32)
|
||||
ifeq ($(HAS_BIARCH),y)
|
||||
AS := $(AS) -a32
|
||||
LD := $(LD) -m elf32ppc
|
||||
CC := $(CC) -m32
|
||||
endif
|
||||
|
||||
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
|
||||
# The -Iarch/$(ARCH)/include is temporary while we are merging
|
||||
KBUILD_CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
|
||||
KBUILD_AFLAGS += -Iarch/$(ARCH)
|
||||
KBUILD_CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
|
||||
-ffixed-r2 -mmultiple
|
||||
|
||||
# No AltiVec instruction when building kernel
|
||||
KBUILD_CFLAGS += $(call cc-option, -mno-altivec)
|
||||
|
||||
CPP = $(CC) -E $(KBUILD_CFLAGS)
|
||||
# Temporary hack until we have migrated to asm-powerpc
|
||||
LINUXINCLUDE += -Iarch/$(ARCH)/include
|
||||
|
||||
CHECKFLAGS += -D__powerpc__
|
||||
|
||||
cpu-as-$(CONFIG_4xx) += -Wa,-m405
|
||||
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
|
||||
|
||||
KBUILD_AFLAGS += $(cpu-as-y)
|
||||
KBUILD_CFLAGS += $(cpu-as-y)
|
||||
|
||||
# Default to the common case.
|
||||
KBUILD_DEFCONFIG := ebony_defconfig
|
||||
|
||||
head-y := arch/ppc/kernel/head.o
|
||||
head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
|
||||
head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
|
||||
head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
|
||||
|
||||
head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
|
||||
|
||||
core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
|
||||
arch/ppc/platforms/ \
|
||||
arch/ppc/mm/ arch/ppc/lib/ \
|
||||
arch/ppc/syslib/ arch/powerpc/sysdev/ \
|
||||
arch/powerpc/lib/
|
||||
core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
|
||||
core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
|
||||
core-$(CONFIG_XMON) += arch/ppc/xmon/
|
||||
drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
|
||||
drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
|
||||
drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
|
||||
|
||||
drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
|
||||
|
||||
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
|
||||
|
||||
PHONY += $(BOOT_TARGETS)
|
||||
|
||||
all: uImage zImage
|
||||
|
||||
CPPFLAGS_vmlinux.lds := -Upowerpc
|
||||
|
||||
# All the instructions talk about "make bzImage".
|
||||
bzImage: zImage
|
||||
|
||||
boot := arch/$(ARCH)/boot
|
||||
|
||||
$(BOOT_TARGETS): vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $@
|
||||
|
||||
uImage: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
|
||||
|
||||
define archhelp
|
||||
@echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
|
||||
@echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
|
||||
@echo ' install - Install kernel using'
|
||||
@echo ' (your) ~/bin/installkernel or'
|
||||
@echo ' (distribution) /sbin/installkernel or'
|
||||
@echo ' install to $$(INSTALL_PATH) and run lilo'
|
||||
@echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
|
||||
endef
|
||||
|
||||
archclean:
|
||||
$(Q)$(MAKE) $(clean)=arch/ppc/boot
|
||||
# Temporary hack until we have migrated to asm-powerpc
|
||||
$(Q)rm -rf arch/$(ARCH)/include
|
||||
|
||||
archprepare: checkbin
|
||||
|
||||
# Temporary hack until we have migrated to asm-powerpc
|
||||
include/asm: arch/$(ARCH)/include/asm
|
||||
arch/$(ARCH)/include/asm:
|
||||
$(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
|
||||
$(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
|
||||
|
||||
# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
|
||||
# to stdout and these checks are run even on install targets.
|
||||
TOUT := .tmp_gas_check
|
||||
# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
|
||||
# instructions.
|
||||
# gcc-3.4 and binutils-2.14 are a fatal combination.
|
||||
|
||||
checkbin:
|
||||
@if test "$(call cc-version)" = "0304" ; then \
|
||||
if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
|
||||
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
|
||||
echo 'correctly with gcc-3.4 and your version of binutils.'; \
|
||||
echo '*** Please upgrade your binutils or downgrade your gcc'; \
|
||||
false; \
|
||||
fi ; \
|
||||
fi
|
||||
@if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
|
||||
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
|
||||
echo 'correctly with old versions of binutils.' ; \
|
||||
echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
|
||||
false ; \
|
||||
fi
|
||||
|
||||
CLEAN_FILES += $(TOUT)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#
|
||||
# arch/ppc/boot/Makefile
|
||||
#
|
||||
# This file is included by the global makefile so that you can add your own
|
||||
# architecture-specific flags and dependencies.
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 1994 by Linus Torvalds
|
||||
# Adapted for PowerPC by Gary Thomas
|
||||
# modified by Cort (cort@cs.nmt.edu)
|
||||
#
|
||||
|
||||
# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
|
||||
KBUILD_CFLAGS += -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include
|
||||
HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
|
||||
|
||||
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
|
||||
|
||||
bootdir-y := simple
|
||||
subdir-y := lib common images
|
||||
subdir-$(CONFIG_PPC_PREP) += of1275
|
||||
|
||||
# for cleaning
|
||||
subdir- += simple
|
||||
|
||||
hostprogs-y := $(addprefix utils/, mkprep mkbugboot mktree)
|
||||
|
||||
PHONY += $(BOOT_TARGETS) $(bootdir-y)
|
||||
|
||||
$(BOOT_TARGETS): $(bootdir-y)
|
||||
|
||||
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
|
||||
$(addprefix $(obj)/,$(hostprogs-y))
|
||||
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
|
||||
@@ -1,10 +0,0 @@
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Tom Rini January 2001
|
||||
#
|
||||
|
||||
lib-y := string.o util.o misc-common.o \
|
||||
serial_stub.o bootinfo.o
|
||||
lib-$(CONFIG_SERIAL_8250_CONSOLE) += ns16550.o
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* General bootinfo record utilities
|
||||
* Author: Randy Vinson <rvinson@mvista.com>
|
||||
*
|
||||
* 2002 (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 <linux/types.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/bootinfo.h>
|
||||
|
||||
#include "nonstdio.h"
|
||||
|
||||
static struct bi_record * birec = NULL;
|
||||
|
||||
static struct bi_record *
|
||||
__bootinfo_build(struct bi_record *rec, unsigned long tag, unsigned long size,
|
||||
void *data)
|
||||
{
|
||||
/* set the tag */
|
||||
rec->tag = tag;
|
||||
|
||||
/* if the caller has any data, copy it */
|
||||
if (size)
|
||||
memcpy(rec->data, (char *)data, size);
|
||||
|
||||
/* set the record size */
|
||||
rec->size = sizeof(struct bi_record) + size;
|
||||
|
||||
/* advance to the next available space */
|
||||
rec = (struct bi_record *)((unsigned long)rec + rec->size);
|
||||
|
||||
return rec;
|
||||
}
|
||||
|
||||
void
|
||||
bootinfo_init(struct bi_record *rec)
|
||||
{
|
||||
|
||||
/* save start of birec area */
|
||||
birec = rec;
|
||||
|
||||
/* create an empty list */
|
||||
rec = __bootinfo_build(rec, BI_FIRST, 0, NULL);
|
||||
(void) __bootinfo_build(rec, BI_LAST, 0, NULL);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
bootinfo_append(unsigned long tag, unsigned long size, void * data)
|
||||
{
|
||||
|
||||
struct bi_record *rec = birec;
|
||||
|
||||
/* paranoia */
|
||||
if ((rec == NULL) || (rec->tag != BI_FIRST))
|
||||
return;
|
||||
|
||||
/* find the last entry in the list */
|
||||
while (rec->tag != BI_LAST)
|
||||
rec = (struct bi_record *)((ulong)rec + rec->size);
|
||||
|
||||
/* overlay BI_LAST record with new one and tag on a new BI_LAST */
|
||||
rec = __bootinfo_build(rec, tag, size, data);
|
||||
(void) __bootinfo_build(rec, BI_LAST, 0, NULL);
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/* Copyright (c) 1997 Paul Mackerras <paulus@cs.anu.edu.au>
|
||||
* Initial Power Macintosh COFF version.
|
||||
* Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
|
||||
* Modifications for IBM PowerPC 400-class processor evaluation
|
||||
* boards.
|
||||
*
|
||||
* Module name: crt0.S
|
||||
*
|
||||
* Description:
|
||||
* Boot loader execution entry point. Clears out .bss section as per
|
||||
* ANSI C requirements. Invalidates and flushes the caches over the
|
||||
* range covered by the boot loader's .text section. Sets up a stack
|
||||
* below the .text section entry point.
|
||||
*
|
||||
* 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 <asm/ppc_asm.h>
|
||||
|
||||
.text
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
#ifdef XCOFF
|
||||
.long __start,0,0
|
||||
|
||||
.globl __start
|
||||
__start:
|
||||
#endif
|
||||
|
||||
## Flush and invalidate the caches for the range in memory covering
|
||||
## the .text section of the boot loader
|
||||
|
||||
lis r9,_start@h # r9 = &_start
|
||||
lis r8,_etext@ha #
|
||||
addi r8,r8,_etext@l # r8 = &_etext
|
||||
3: dcbf r0,r9 # Flush the data cache
|
||||
icbi r0,r9 # Invalidate the instruction cache
|
||||
addi r9,r9,0x10 # Increment by one cache line
|
||||
cmplw cr0,r9,r8 # Are we at the end yet?
|
||||
blt 3b # No, keep flushing and invalidating
|
||||
sync # sync ; isync after flushing the icache
|
||||
isync
|
||||
|
||||
## Clear out the BSS as per ANSI C requirements
|
||||
|
||||
lis r7,_end@ha
|
||||
addi r7,r7,_end@l # r7 = &_end
|
||||
lis r8,__bss_start@ha #
|
||||
addi r8,r8,__bss_start@l # r8 = &_bss_start
|
||||
|
||||
## Determine how large an area, in number of words, to clear
|
||||
|
||||
subf r7,r8,r7 # r7 = &_end - &_bss_start + 1
|
||||
addi r7,r7,3 # r7 += 3
|
||||
srwi. r7,r7,2 # r7 = size in words.
|
||||
beq 2f # If the size is zero, do not bother
|
||||
addi r8,r8,-4 # r8 -= 4
|
||||
mtctr r7 # SPRN_CTR = number of words to clear
|
||||
li r0,0 # r0 = 0
|
||||
1: stwu r0,4(r8) # Clear out a word
|
||||
bdnz 1b # If we are not done yet, keep clearing
|
||||
2:
|
||||
|
||||
#ifdef CONFIG_40x
|
||||
## Set up the stack
|
||||
|
||||
lis r9,_start@h # r9 = &_start (text section entry)
|
||||
ori r9,r9,_start@l
|
||||
subi r1,r9,64 # Start the stack 64 bytes below _start
|
||||
clrrwi r1,r1,4 # Make sure it is aligned on 16 bytes.
|
||||
li r0,0
|
||||
stwu r0,-16(r1)
|
||||
mtlr r9
|
||||
#endif
|
||||
|
||||
b start # All done, start the real work.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user