Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e90ddd81 authored by Dan Williams's avatar Dan Williams Committed by Russell King
Browse files

[ARM] 4348/4: iop3xx: Give Linux control over PCI initialization



Currently the iop3xx platform support code assumes that RedBoot is the
bootloader and has already initialized the ATU.  Linux should handle this
initialization for three reasons:

1/ The memory map that RedBoot sets up is not optimal (page_to_dma and
virt_to_phys return different addresses).  The effect of this is that using
the dma mapping API for the internal bus dma units generates pci bus
addresses that are incorrect for the internal bus.

2/ Not all iop platforms use RedBoot

3/ If the ATU is already initialized it indicates that the iop is an add-in
card in another host, it does not own the PCI bus, and should not be
re-initialized.

Changelog:
* rather than change nr_controllers to zero, simply do not call
  pci_common_init

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent fa543f00
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ config MACH_N2100
	  Say Y here if you want to run your kernel on the Thecus n2100
	  NAS appliance.

config IOP3XX_ATU
        bool "Enable the PCI Controller"
        default y
        help
          Say Y here if you want the IOP to initialize its PCI Controller.
          Say N if the IOP is an add in card, the host system owns the PCI
          bus in this case.

endmenu

endif
+7 −4
Original line number Diff line number Diff line
@@ -178,9 +178,10 @@ static struct hw_pci iq31244_pci __initdata = {

static int __init iq31244_pci_init(void)
{
	if (is_ep80219())
	if (is_ep80219()) {
		if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
			pci_common_init(&ep80219_pci);
	else if (machine_is_iq31244()) {
	} else if (machine_is_iq31244()) {
		if (is_80219()) {
			printk("note: iq31244 board type has been selected\n");
			printk("note: to select ep80219 operation:\n");
@@ -189,6 +190,8 @@ static int __init iq31244_pci_init(void)
			printk("\t2/ update boot loader to pass"
				" the ep80219 id: %d\n", MACH_TYPE_EP80219);
		}

		if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
			pci_common_init(&iq31244_pci);
	}

+2 −1
Original line number Diff line number Diff line
@@ -113,7 +113,8 @@ static struct hw_pci iq80321_pci __initdata = {

static int __init iq80321_pci_init(void)
{
	if (machine_is_iq80321())
	if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
		machine_is_iq80321())
		pci_common_init(&iq80321_pci);

	return 0;
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,14 @@ config MACH_IQ80332
	  Say Y here if you want to run your kernel on the Intel IQ80332
	  evaluation kit for the IOP332 chipset.

config IOP3XX_ATU
	bool "Enable the PCI Controller"
	default y
	help
	  Say Y here if you want the IOP to initialize its PCI Controller.
	  Say N if the IOP is an add in card, the host system owns the PCI
	  bus in this case.

endmenu

endif
+2 −1
Original line number Diff line number Diff line
@@ -96,7 +96,8 @@ static struct hw_pci iq80331_pci __initdata = {

static int __init iq80331_pci_init(void)
{
	if (machine_is_iq80331())
	if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
		machine_is_iq80331())
		pci_common_init(&iq80331_pci);

	return 0;
Loading