mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
pci: fsl_pci_init: Dynamically allocate the PCI regions
Commite002474158
("pci: pci-uclass: Dynamically allocate the PCI regions") changes 'struct pci_controller'.regions from pre-allocated array of regions to dynamically allocated, which unfortunately broken lots of boards that still use the non-DM PCI driver. This patch changes the non-DM fsl_pci_init driver to dynamically allocate the regions, just like what's done in the pci uclass driver. Fixes:e002474158
("pci: pci-uclass: Dynamically allocate the PCI regions") Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
This commit is contained in:
parent
714555374f
commit
7365a03804
@ -32,6 +32,8 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/fsl_pci.h>
|
#include <asm/fsl_pci.h>
|
||||||
|
|
||||||
|
#define MAX_PCI_REGIONS 7
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_PCI_MEMORY_BUS
|
#ifndef CONFIG_SYS_PCI_MEMORY_BUS
|
||||||
#define CONFIG_SYS_PCI_MEMORY_BUS 0
|
#define CONFIG_SYS_PCI_MEMORY_BUS 0
|
||||||
#endif
|
#endif
|
||||||
@ -80,6 +82,9 @@ int fsl_setup_hose(struct pci_controller *hose, unsigned long addr)
|
|||||||
/* Reset hose to make sure its in a clean state */
|
/* Reset hose to make sure its in a clean state */
|
||||||
memset(hose, 0, sizeof(struct pci_controller));
|
memset(hose, 0, sizeof(struct pci_controller));
|
||||||
|
|
||||||
|
hose->regions = (struct pci_region *)
|
||||||
|
calloc(1, MAX_PCI_REGIONS * sizeof(struct pci_region));
|
||||||
|
|
||||||
pci_setup_indirect(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
|
pci_setup_indirect(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
|
||||||
|
|
||||||
return fsl_is_pci_agent(hose);
|
return fsl_is_pci_agent(hose);
|
||||||
|
Loading…
Reference in New Issue
Block a user