Commit e96d7b3d authored by Dan Cox's avatar Dan Cox Committed by Tom Rini

PPC32: Add support for the SBS Palomar 4 embedded board.

parent 50612ca2
......@@ -131,6 +131,7 @@ if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ]; then
Motorola-Sandpoint CONFIG_SANDPOINT \
SBS-Adirondack CONFIG_ADIR \
SBS-K2 CONFIG_K2 \
SBS-Palomar4 CONFIG_PAL4 \
Synergy-Gemini CONFIG_GEMINI \
Zynx-ZX4500 CONFIG_ZX4500" CHRP/PowerMac/PReP
......
......@@ -37,6 +37,7 @@ obj-$(CONFIG_LOPEC) += lopec_setup.o lopec_pci.o
obj-$(CONFIG_MCPN765) += mcpn765_setup.o mcpn765_pci.o
obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o
obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o
obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o cpc700_pic.o
obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o
obj-$(CONFIG_POWERPMC250) += powerpmc250.o
obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
......
/*
* arch/ppc/platforms/pal4.h
*
* Definitions for SBS Palomar IV board
*
* Author: Dan Cox
*
* Copyright 2002 MontaVista Software Inc.
*
* 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.
*/
#ifndef __PPC_PLATFORMS_PAL4_H
#define __PPC_PLATFORMS_PAL4_H
#define PAL4_NVRAM 0xfffc0000
#define PAL4_NVRAM_SIZE 0x8000
#define PAL4_DRAM 0xfff80000
#define PAL4_DRAM_BR_MASK 0xc0
#define PAL4_DRAM_BR_SHIFT 6
#define PAL4_DRAM_RESET 0x10
#define PAL4_DRAM_EREADY 0x40
#define PAL4_MISC 0xfff80004
#define PAL4_MISC_FB_MASK 0xc0
#define PAL4_MISC_FLASH 0x20 /* StratFlash mapping: 1->0xff80, 0->0xfff0 */
#define PAL4_MISC_MISC 0x08
#define PAL4_MISC_BITF 0x02
#define PAL4_MISC_NVKS 0x01
#define PAL4_L2 0xfff80008
#define PAL4_L2_MASK 0x07
#define PAL4_PLDR 0xfff8000c
/* Only two Ethernet devices on the board... */
#define PAL4_ETH 31
#define PAL4_INTA 20
#endif /* __PPC_PLATFORMS_PAL4_H */
/*
* arch/ppc/platforms/pal4_pci.c
*
* PCI support for SBS Palomar IV
*
* Author: Dan Cox
*
* Copyright 2002 MontaVista Software Inc.
*
* 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 <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/byteorder.h>
#include <asm/machdep.h>
#include <asm/io.h>
#include <asm/pci-bridge.h>
#include <asm/uaccess.h>
#include "cpc700.h"
#include "pal4.h"
/* not much to this.... */
static inline int __init
pal4_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
if (idsel == 9)
return PAL4_ETH;
else
return PAL4_INTA + (idsel - 3);
}
void __init
pal4_find_bridges(void)
{
struct pci_controller *hose;
hose = pcibios_alloc_controller();
if (!hose)
return;
hose->first_busno = 0;
hose->last_busno = 0xff;
hose->pci_mem_offset = 0;
/* Could snatch these from the CPC700.... */
pci_init_resource(&hose->io_resource,
0x0,
0x03ffffff,
IORESOURCE_IO,
"PCI host bridge");
pci_init_resource(&hose->mem_resources[0],
0x90000000,
0x9fffffff,
IORESOURCE_MEM,
"PCI host bridge");
hose->io_space.start = 0x00800000;
hose->io_space.end = 0x03ffffff;
hose->mem_space.start = 0x90000000;
hose->mem_space.end = 0x9fffffff;
hose->io_base_virt = (void *) 0xf8000000;
setup_indirect_pci(hose, CPC700_PCI_CONFIG_ADDR,
CPC700_PCI_CONFIG_DATA);
hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
ppc_md.pci_swizzle = common_swizzle;
ppc_md.pci_map_irq = pal4_map_irq;
}
/*
* arch/ppc/platforms/pal4_serial.h
*
* Definitions for SBS PalomarIV serial support
*
* Author: Dan Cox
*
* Copyright 2002 MontaVista Software Inc.
*
* 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.
*/
#ifndef __PPC_PAL4_SERIAL_H
#define __PPC_PAL4_SERIAL_H
#define CPC700_SERIAL_1 0xff600300
#define CPC700_SERIAL_2 0xff600400
#define RS_TABLE_SIZE 2
#define BASE_BAUD (33333333 / 4 / 16)
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF)
#endif
#define SERIAL_PORT_DFNS \
{0, BASE_BAUD, CPC700_SERIAL_1, 3, STD_COM_FLAGS, \
iomem_base: (unsigned char *) CPC700_SERIAL_1, \
io_type: SERIAL_IO_MEM}, /* ttyS0 */ \
{0, BASE_BAUD, CPC700_SERIAL_2, 4, STD_COM_FLAGS, \
iomem_base: (unsigned char *) CPC700_SERIAL_2, \
io_type: SERIAL_IO_MEM}
#endif
/*
* arch/ppc/platforms/pal4_setup.c
*
* Board setup routines for the SBS PalomarIV.
*
* Author: Dan Cox
*
* Copyright 2002 MontaVista Software Inc.
*
* 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 <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/reboot.h>
#include <linux/time.h>
#include <linux/irq.h>
#include <linux/kdev_t.h>
#include <linux/blk.h>
#include <linux/console.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/io.h>
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include "cpc700.h"
#include "pal4.h"
extern void pal4_find_bridges(void);
unsigned int cpc700_irq_assigns[][2] = {
{1, 1}, /* IRQ 0: ECC correctable error */
{1, 1}, /* IRQ 1: PCI write to memory range */
{0, 1}, /* IRQ 2: PCI write to command register */
{0, 1}, /* IRQ 3: UART 0 */
{0, 1}, /* IRQ 4: UART 1 */
{0, 1}, /* IRQ 5: ICC 0 */
{0, 1}, /* IRQ 6: ICC 1 */
{0, 1}, /* IRQ 7: GPT compare 0 */
{0, 1}, /* IRQ 8: GPT compare 1 */
{0, 1}, /* IRQ 9: GPT compare 2 */
{0, 1}, /* IRQ 10: GPT compare 3 */
{0, 1}, /* IRQ 11: GPT compare 4 */
{0, 1}, /* IRQ 12: GPT capture 0 */
{0, 1}, /* IRQ 13: GPT capture 1 */
{0, 1}, /* IRQ 14: GPT capture 2 */
{0, 1}, /* IRQ 15: GPT capture 3 */
{0, 1}, /* IRQ 16: GPT capture 4 */
{0, 0}, /* IRQ 17: reserved */
{0, 0}, /* IRQ 18: reserved */
{0, 0}, /* IRQ 19: reserved */
{0, 0}, /* IRQ 20: reserved */
{0, 1}, /* IRQ 21: Ethernet */
{0, 0}, /* IRQ 22: reserved */
{0, 0}, /* IRQ 23: reserved */
{0, 0}, /* IRQ 24: resreved */
{0, 0}, /* IRQ 25: reserved */
{0, 0}, /* IRQ 26: reserved */
{0, 0}, /* IRQ 27: reserved */
{0, 0}, /* IRQ 28: reserved */
{0, 0}, /* IRQ 29: reserved */
{0, 0}, /* IRQ 30: reserved */
{0, 0}, /* IRQ 31: reserved */
};
static int
pal4_show_cpuinfo(struct seq_file *m)
{
seq_printf(m, "board\t\t: SBS Palomar IV\n");
return 0;
}
static void
pal4_restart(char *cmd)
{
__cli();
__asm__ __volatile__("lis 3,0xfff0\n \
ori 3,3,0x100\n \
mtspr 26,3\n \
li 3,0\n \
mtspr 27,3\n \
rfi");
for(;;);
}
static void
pal4_power_off(void)
{
__cli();
for(;;);
}
static void
pal4_halt(void)
{
pal4_power_off();
}
TODC_ALLOC();
static void __init
pal4_setup_arch(void)
{
unsigned long l2;
TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
ioremap(PAL4_NVRAM, PAL4_NVRAM_SIZE), 8);
pal4_find_bridges();
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = Root_RAM0;
else
#endif
ROOT_DEV = Root_NFS;
/* The L2 gets disabled in the bootloader, but all the proper
bits should be present from the fw, so just re-enable it */
l2 = _get_L2CR();
if (!(l2 & L2CR_L2E)) {
/* presume that it was initially set if the size is
still present. */
if (l2 ^ L2CR_L2SIZ_MASK)
_set_L2CR(l2 | L2CR_L2E);
else
printk("L2 not set by firmware; left disabled.\n");
}
}
static void __init
pal4_map_io(void)
{
io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
}
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
parse_bootinfo(find_bootinfo());
isa_io_base = 0 /*PAL4_ISA_IO_BASE*/;
pci_dram_offset = 0 /*PAL4_PCI_SYS_MEM_BASE*/;
ppc_md.setup_arch = pal4_setup_arch;
ppc_md.show_cpuinfo = pal4_show_cpuinfo;
ppc_md.setup_io_mappings = pal4_map_io;
ppc_md.init_IRQ = cpc700_init_IRQ;
ppc_md.get_irq = cpc700_get_irq;
ppc_md.restart = pal4_restart;
ppc_md.halt = pal4_halt;
ppc_md.power_off = pal4_power_off;
ppc_md.time_init = todc_time_init;
ppc_md.set_rtc_time = todc_set_rtc_time;
ppc_md.get_rtc_time = todc_get_rtc_time;
ppc_md.calibrate_decr = todc_calibrate_decr;
ppc_md.nvram_read_val = todc_direct_read_val;
ppc_md.nvram_write_val = todc_direct_write_val;
}
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