2007-01-16 16:38:14 +00:00
|
|
|
/*
|
|
|
|
* pci.c -- WindRiver SBC8349 PCI board support.
|
|
|
|
* Copyright (c) 2006 Wind River Systems, Inc.
|
2009-07-18 23:42:13 +00:00
|
|
|
* Copyright (C) 2006-2009 Freescale Semiconductor, Inc.
|
2007-01-16 16:38:14 +00:00
|
|
|
*
|
|
|
|
* Based on MPC8349 PCI support but w/o PIB related code.
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2007-01-16 16:38:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/mmu.h>
|
2009-07-18 23:42:13 +00:00
|
|
|
#include <asm/io.h>
|
2007-01-16 16:38:14 +00:00
|
|
|
#include <common.h>
|
2009-07-18 23:42:13 +00:00
|
|
|
#include <mpc83xx.h>
|
2007-01-16 16:38:14 +00:00
|
|
|
#include <pci.h>
|
|
|
|
#include <i2c.h>
|
2009-07-18 23:42:13 +00:00
|
|
|
#include <asm/fsl_i2c.h>
|
2007-01-16 16:38:14 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2009-07-18 23:42:13 +00:00
|
|
|
static struct pci_region pci1_regions[] = {
|
|
|
|
{
|
|
|
|
bus_start: CONFIG_SYS_PCI1_MEM_BASE,
|
|
|
|
phys_start: CONFIG_SYS_PCI1_MEM_PHYS,
|
|
|
|
size: CONFIG_SYS_PCI1_MEM_SIZE,
|
|
|
|
flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
|
|
|
|
},
|
|
|
|
{
|
|
|
|
bus_start: CONFIG_SYS_PCI1_IO_BASE,
|
|
|
|
phys_start: CONFIG_SYS_PCI1_IO_PHYS,
|
|
|
|
size: CONFIG_SYS_PCI1_IO_SIZE,
|
|
|
|
flags: PCI_REGION_IO
|
|
|
|
},
|
|
|
|
{
|
|
|
|
bus_start: CONFIG_SYS_PCI1_MMIO_BASE,
|
|
|
|
phys_start: CONFIG_SYS_PCI1_MMIO_PHYS,
|
|
|
|
size: CONFIG_SYS_PCI1_MMIO_SIZE,
|
|
|
|
flags: PCI_REGION_MEM
|
2007-01-16 16:38:14 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2009-07-18 23:42:13 +00:00
|
|
|
/*
|
2007-01-16 16:38:14 +00:00
|
|
|
* pci_init_board()
|
|
|
|
*
|
|
|
|
* NOTICE: PCI2 is not supported. There is only one
|
|
|
|
* physical PCI slot on the board.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
pci_init_board(void)
|
|
|
|
{
|
2009-07-18 23:42:13 +00:00
|
|
|
volatile immap_t *immr = (volatile immap_t *)CONFIG_SYS_IMMR;
|
|
|
|
volatile clk83xx_t *clk = (volatile clk83xx_t *)&immr->clk;
|
|
|
|
volatile law83xx_t *pci_law = immr->sysconf.pcilaw;
|
|
|
|
struct pci_region *reg[] = { pci1_regions };
|
2007-01-16 16:38:14 +00:00
|
|
|
|
2009-07-18 23:42:13 +00:00
|
|
|
/* Enable all 8 PCI_CLK_OUTPUTS */
|
2007-01-16 16:38:14 +00:00
|
|
|
clk->occr = 0xff000000;
|
|
|
|
udelay(2000);
|
|
|
|
|
2009-07-18 23:42:13 +00:00
|
|
|
/* Configure PCI Local Access Windows */
|
2008-10-16 13:01:15 +00:00
|
|
|
pci_law[0].bar = CONFIG_SYS_PCI1_MEM_PHYS & LAWBAR_BAR;
|
2007-01-16 16:38:14 +00:00
|
|
|
pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_1G;
|
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
pci_law[1].bar = CONFIG_SYS_PCI1_IO_PHYS & LAWBAR_BAR;
|
2007-01-16 16:38:14 +00:00
|
|
|
pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_4M;
|
|
|
|
|
2009-07-18 23:42:13 +00:00
|
|
|
udelay(2000);
|
2007-12-20 20:09:22 +00:00
|
|
|
|
2010-09-15 00:13:50 +00:00
|
|
|
mpc83xx_pci_init(1, reg);
|
2007-12-20 20:09:22 +00:00
|
|
|
}
|