All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] decode_regions() function
@ 2017-02-08 21:58 york sun
  2017-02-08 22:12 ` Simon Glass
  0 siblings, 1 reply; 4+ messages in thread
From: york sun @ 2017-02-08 21:58 UTC (permalink / raw)
  To: u-boot

Simon,

I stumped on this issue when I was rewriting the code to reserve secure 
memory. I didn't realize gd->ram_size was used in the driver. I made the 
top of memory secure so EL2 code wouldn't be able to access. All of the 
sudden my PCI device failed. By reducing the gd->ram_size, PCI works again.

Can you help me to understand a function in drivers/pci/pci-uclass.c? 
Around line 818 in function

static int decode_regions(struct pci_controller *hose, const void *blob,
                           int parent_node, int node)


         /* Add a region for our local memory */
         size = gd->ram_size;
#ifdef CONFIG_SYS_SDRAM_BASE
         base = CONFIG_SYS_SDRAM_BASE;
#endif
         if (gd->pci_ram_top && gd->pci_ram_top < base + size)
                 size = gd->pci_ram_top - base;
         pci_set_region(hose->regions + hose->region_count++, base, base,
                        size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);


What would happen if pci_ram_top is not set, and the memory is split 
into banks? gd->ram_size would have the total memory, but not in 
continuous space. Is adding a single region correct here?

York

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-09 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 21:58 [U-Boot] decode_regions() function york sun
2017-02-08 22:12 ` Simon Glass
2017-02-08 22:56   ` york sun
2017-02-09 17:36     ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.