Path: blob/master/arch/powerpc/platforms/embedded6xx/mpc10x.h
26489 views
/*1* Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem2* ctlr/EPIC/etc.3*4* Author: Mark A. Greer5* [email protected]6*7* 2001 (c) MontaVista, Software, Inc. This file is licensed under8* the terms of the GNU General Public License version 2. This program9* is licensed "as is" without any warranty of any kind, whether express10* or implied.11*/12#ifndef __PPC_KERNEL_MPC10X_H13#define __PPC_KERNEL_MPC10X_H1415#include <linux/pci_ids.h>16#include <asm/pci-bridge.h>1718/*19* The values here don't completely map everything but should work in most20* cases.21*22* MAP A (PReP Map)23* Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff24* Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff25* PCI MEM: 0x80000000 -> Processor System Memory: 0x0000000026*27* MAP B (CHRP Map)28* Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff29* Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff30* PCI MEM: 0x00000000 -> Processor System Memory: 0x0000000031*/3233/*34* Define the vendor/device IDs for the various bridges--should be added to35* <linux/pci_ids.h>36*/37#define MPC10X_BRIDGE_106 ((PCI_DEVICE_ID_MOTOROLA_MPC106 << 16) | \38PCI_VENDOR_ID_MOTOROLA)39#define MPC10X_BRIDGE_8240 ((0x0003 << 16) | PCI_VENDOR_ID_MOTOROLA)40#define MPC10X_BRIDGE_107 ((0x0004 << 16) | PCI_VENDOR_ID_MOTOROLA)41#define MPC10X_BRIDGE_8245 ((0x0006 << 16) | PCI_VENDOR_ID_MOTOROLA)4243/* Define the type of map to use */44#define MPC10X_MEM_MAP_A 145#define MPC10X_MEM_MAP_B 24647/* Map A (PReP Map) Defines */48#define MPC10X_MAPA_CNFG_ADDR 0x80000cf849#define MPC10X_MAPA_CNFG_DATA 0x80000cfc5051#define MPC10X_MAPA_ISA_IO_BASE 0x8000000052#define MPC10X_MAPA_ISA_MEM_BASE 0xc000000053#define MPC10X_MAPA_DRAM_OFFSET 0x800000005455#define MPC10X_MAPA_PCI_INTACK_ADDR 0xbffffff056#define MPC10X_MAPA_PCI_IO_START 0x0000000057#define MPC10X_MAPA_PCI_IO_END (0x00800000 - 1)58#define MPC10X_MAPA_PCI_MEM_START 0x0000000059#define MPC10X_MAPA_PCI_MEM_END (0x20000000 - 1)6061#define MPC10X_MAPA_PCI_MEM_OFFSET (MPC10X_MAPA_ISA_MEM_BASE - \62MPC10X_MAPA_PCI_MEM_START)6364/* Map B (CHRP Map) Defines */65#define MPC10X_MAPB_CNFG_ADDR 0xfec0000066#define MPC10X_MAPB_CNFG_DATA 0xfee000006768#define MPC10X_MAPB_ISA_IO_BASE 0xfe00000069#define MPC10X_MAPB_ISA_MEM_BASE 0x8000000070#define MPC10X_MAPB_DRAM_OFFSET 0x000000007172#define MPC10X_MAPB_PCI_INTACK_ADDR 0xfef0000073#define MPC10X_MAPB_PCI_IO_START 0x0000000074#define MPC10X_MAPB_PCI_IO_END (0x00c00000 - 1)75#define MPC10X_MAPB_PCI_MEM_START 0x8000000076#define MPC10X_MAPB_PCI_MEM_END (0xc0000000 - 1)7778#define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \79MPC10X_MAPB_PCI_MEM_START)8081/* Miscellaneous Configuration register offsets */82#define MPC10X_CFG_PIR_REG 0x0983#define MPC10X_CFG_PIR_HOST_BRIDGE 0x0084#define MPC10X_CFG_PIR_AGENT 0x018586#define MPC10X_CFG_EUMBBAR 0x788788#define MPC10X_CFG_PICR1_REG 0xa889#define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x0001000090#define MPC10X_CFG_PICR1_ADDR_MAP_A 0x0001000091#define MPC10X_CFG_PICR1_ADDR_MAP_B 0x0000000092#define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x0000000493#define MPC10X_CFG_PICR1_ST_GATH_EN 0x000000409495#define MPC10X_CFG_PICR2_REG 0xac96#define MPC10X_CFG_PICR2_COPYBACK_OPT 0x000000019798#define MPC10X_CFG_MAPB_OPTIONS_REG 0xe099#define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */100#define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */101#define MPC10X_CFG_MAPB_OPTIONS_DR 0x20 /* DLL_RESET */102#define MPC10X_CFG_MAPB_OPTIONS_PCICH 0x08 /* PCI_COMPATIBILITY_HOLE */103#define MPC10X_CFG_MAPB_OPTIONS_PROCCH 0x04 /* PROC_COMPATIBILITY_HOLE */104105/* Define offsets for the memory controller registers in the config space */106#define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */107#define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */108#define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */109#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */110111#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */112#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */113#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */114#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */115116#define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0117118/* Define some offset in the EUMB */119#define MPC10X_EUMB_SIZE 0x00100000 /* Total EUMB size (1MB) */120121#define MPC10X_EUMB_MU_OFFSET 0x00000000 /* Msg Unit reg offset */122#define MPC10X_EUMB_MU_SIZE 0x00001000 /* Msg Unit reg size */123#define MPC10X_EUMB_DMA_OFFSET 0x00001000 /* DMA Unit reg offset */124#define MPC10X_EUMB_DMA_SIZE 0x00001000 /* DMA Unit reg size */125#define MPC10X_EUMB_ATU_OFFSET 0x00002000 /* Addr xlate reg offset */126#define MPC10X_EUMB_ATU_SIZE 0x00001000 /* Addr xlate reg size */127#define MPC10X_EUMB_I2C_OFFSET 0x00003000 /* I2C Unit reg offset */128#define MPC10X_EUMB_I2C_SIZE 0x00001000 /* I2C Unit reg size */129#define MPC10X_EUMB_DUART_OFFSET 0x00004000 /* DUART Unit reg offset (8245) */130#define MPC10X_EUMB_DUART_SIZE 0x00001000 /* DUART Unit reg size (8245) */131#define MPC10X_EUMB_EPIC_OFFSET 0x00040000 /* EPIC offset in EUMB */132#define MPC10X_EUMB_EPIC_SIZE 0x00030000 /* EPIC size */133#define MPC10X_EUMB_PM_OFFSET 0x000fe000 /* Performance Monitor reg offset (8245) */134#define MPC10X_EUMB_PM_SIZE 0x00001000 /* Performance Monitor reg size (8245) */135#define MPC10X_EUMB_WP_OFFSET 0x000ff000 /* Data path diagnostic, watchpoint reg offset */136#define MPC10X_EUMB_WP_SIZE 0x00001000 /* Data path diagnostic, watchpoint reg size */137138enum ppc_sys_devices {139MPC10X_IIC1,140MPC10X_DMA0,141MPC10X_DMA1,142MPC10X_UART0,143MPC10X_UART1,144NUM_PPC_SYS_DEVS,145};146147int mpc10x_bridge_init(struct pci_controller *hose,148uint current_map,149uint new_map,150uint phys_eumb_base);151unsigned long mpc10x_get_mem_size(uint mem_map);152int mpc10x_enable_store_gathering(struct pci_controller *hose);153int mpc10x_disable_store_gathering(struct pci_controller *hose);154155/* For MPC107 boards that use the built-in openpic */156void mpc10x_set_openpic(void);157158void avr_uart_configure(void);159void avr_uart_send(const char c);160161#endif /* __PPC_KERNEL_MPC10X_H */162163164