AMD NB: Limit the device field to 5 bits. (Propagation)
Apply the change http://review.coreboot.org/1264 to all the AMD northbridge. Change-Id: Ied74d6f579d2c0350288e2619d7810f8d44fa574 Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: zbao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/1403 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
		@@ -361,8 +361,8 @@ static void set_mmio_addr_reg(u32 nodeid, u32 linkn, u32 reg, u32 index, u32 mmi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static device_t get_node_pci(u32 nodeid, u32 fn)
 | 
					static device_t get_node_pci(u32 nodeid, u32 fn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if NODE_NUMS == 64
 | 
					#if NODE_NUMS + CONFIG_CDB >= 32
 | 
				
			||||||
	if (nodeid < 32) {
 | 
						if ((CONFIG_CDB + nodeid) < 32) {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
							return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
							return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,7 +50,11 @@ static unsigned fx_devs=0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
device_t get_node_pci(u32 nodeid, u32 fn)
 | 
					device_t get_node_pci(u32 nodeid, u32 fn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if ((CONFIG_CDB + nodeid) < 32) {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
							return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -51,7 +51,11 @@ static unsigned fx_devs = 0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
device_t get_node_pci(u32 nodeid, u32 fn)
 | 
					device_t get_node_pci(u32 nodeid, u32 fn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if ((CONFIG_CDB + nodeid) < 32) {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
							return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void get_fx_devs(void)
 | 
					static void get_fx_devs(void)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -122,8 +122,8 @@ static void set_mmio_addr_reg(u32 nodeid, u32 linkn, u32 reg, u32 index, u32 mmi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static device_t get_node_pci(u32 nodeid, u32 fn)
 | 
					static device_t get_node_pci(u32 nodeid, u32 fn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if MAX_NODE_NUMS == 64
 | 
					#if MAX_NODE_NUMS + CONFIG_CDB >= 32
 | 
				
			||||||
	if (nodeid < 32) {
 | 
						if ((CONFIG_CDB + nodeid) < 32) {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
							return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
							return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,8 +63,8 @@ static unsigned fx_devs=0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
device_t get_node_pci(u32 nodeid, u32 fn)
 | 
					device_t get_node_pci(u32 nodeid, u32 fn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if NODE_NUMS == 64
 | 
					#if NODE_NUMS + CONFIG_CDB >= 32
 | 
				
			||||||
	if(nodeid<32) {
 | 
						if((CONFIG_CDB + nodeid) < 32) {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
							return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn));
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
							return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user