Skip to content

Commit 349231b

Browse files
dgarskedanielinux
authored andcommitted
Cleanups.
1 parent 275222f commit 349231b

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

hal/nxp_t1024.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,9 +1408,14 @@ static int hal_pcie_init(void)
14081408
set32( PCIE_IWAR(pcie_bus, 3), (PIWAR_PF | PIWAR_TRGT_LOCAL |
14091409
PIWAR_READ | PIWAR_WRITE | LAW_SIZE_1TB));
14101410

1411-
/* Check if link is active */
1412-
1411+
#define PCI_LTSSM 0x404 /* PCIe Link Training, Status State Machine */
1412+
#define PCI_LTSSM_L0 0x16 /* L0 state */
14131413

1414+
/* TODO: Check if link is active. Read config PCI_LTSSM */
1415+
#if 0
1416+
link = pci_config_read16(0, 0, 0, PCI_LTSSM);
1417+
enabled = (link >= PCI_LTSSM_L0);
1418+
#endif
14141419
}
14151420

14161421
/* Only enumerate PCIe 3 */
@@ -2465,6 +2470,7 @@ int hal_dts_fixup(void* dts_addr)
24652470
}
24662471
}
24672472
#endif /* !BUILD_LOADER_STAGE1 */
2473+
(void)dts_addr;
24682474
return 0;
24692475
}
24702476
#endif /* MMU */

src/boot_ppc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ void __attribute((weak)) hal_early_init(void)
108108
#ifdef MMU
109109
int __attribute((weak)) hal_dts_fixup(void* dts_addr)
110110
{
111+
(void)dts_addr;
111112
return 0;
112113
}
113114
#endif

src/pci.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,10 @@ static uint16_t pci_io_config_read16(uint32_t bus, uint32_t dev, uint32_t func,
235235

236236
address = pci_align32_address(address, &aligned32);
237237
data = pci_io_config_read32(bus, dev, func, address);
238-
//PCI_DEBUG_PRINTF("CONFIG_READ16: address %x, data %x (aligned32 %d)\n", address, data, aligned32);
239238
if (!aligned32)
240239
data >>= PCI_DATA_HI16_SHIFT;
241240
else
242241
data &= PCI_DATA_LO16_MASK;
243-
//PCI_DEBUG_PRINTF("\tCONFIG_READ16: data %x\n", data);
244242
return (uint16_t)data;
245243
}
246244

@@ -257,15 +255,13 @@ static void pci_io_config_write16(uint32_t bus, uint32_t dev, uint32_t func,
257255

258256
dst_addr = pci_align32_address(dst_addr, &aligned32);
259257
reg = pci_io_config_read32(bus, dev, func, dst_addr);
260-
//PCI_DEBUG_PRINTF("CONFIG_WRITE16: address %x, data %x (aligned32 %d)\n", dst_addr, val, aligned32);
261258
if (aligned32) {
262259
reg &= PCI_DATA_HI16_MASK;
263260
reg |= val;
264261
} else {
265262
reg &= PCI_DATA_LO16_MASK;
266263
reg |= (val << PCI_DATA_HI16_SHIFT);
267264
}
268-
//PCI_DEBUG_PRINTF("\tCONFIG_WRITE16: data %x\n", reg);
269265
pci_io_config_write32(bus, dev, func, dst_addr, reg);
270266
}
271267
#endif /* PCI_USE_ECAM */
@@ -319,10 +315,8 @@ void pci_config_write8(uint8_t bus,
319315
reg = pci_config_read32(bus, dev, fun, off_aligned);
320316
shift = (off & PCI_ADDR_32BIT_ALIGNED_MASK) * 8;
321317
mask = 0xff << shift;
322-
//PCI_DEBUG_PRINTF("CONFIG_WRITE8: address %x, data %x (mask %x, shift %d)\n", off_aligned, value, mask, shift);
323318
reg &= ~(mask);
324319
reg |= (value << shift);
325-
//PCI_DEBUG_PRINTF("\tCONFIG_WRITE8: data %x\n", reg);
326320
pci_config_write32(bus, dev, fun, off_aligned, reg);
327321
}
328322

@@ -336,10 +330,8 @@ uint8_t pci_config_read8(uint8_t bus, uint8_t dev, uint8_t fun, uint8_t off)
336330
reg = pci_config_read32(bus, dev, fun, off_aligned);
337331
shift = (off & PCI_ADDR_32BIT_ALIGNED_MASK) * 8;
338332
mask = 0xff << shift;
339-
//PCI_DEBUG_PRINTF("CONFIG_READ8: address %x, data %x (mask %x, shift %d)\n", off_aligned, reg, mask, shift);
340333
reg &= mask;
341334
reg = (reg >> shift);
342-
//PCI_DEBUG_PRINTF("\tCONFIG_READ8: data %x\n", reg);
343335
return reg;
344336
}
345337

@@ -420,6 +412,10 @@ static int pci_pre_enum_cb(uint8_t bus, uint8_t dev, uint8_t fun)
420412
/* PMC BARs shouldn't be programmed as per FSP integration guide */
421413
if (dev == 31 && fun == 2)
422414
return 1;
415+
#else
416+
(void)bus;
417+
(void)dev;
418+
(void)fun;
423419
#endif /* WOLFBOOT_TGL */
424420
return 0;
425421
}
@@ -630,9 +626,6 @@ static int pci_program_bridge(uint8_t bus, uint8_t dev, uint8_t fun,
630626
pci_config_write8(bus, dev, fun, PCI_PRIMARY_BUS, bus);
631627
pci_config_write8(bus, dev, fun, PCI_SECONDARY_BUS, info->curr_bus_number);
632628

633-
PCI_DEBUG_PRINTF("Info: bus %d, mem %p-%p, io %p, pf %p-%p\n",
634-
info->curr_bus_number, info->mem, info->mem_limit, info->io, info->mem_pf, info->mem_pf_limit);
635-
636629
/* temporarly allows all conf transaction on the bus range
637630
* (curr_bus_number,0xff) to scan the bus behind the bridge */
638631
pci_config_write8(bus, dev, fun, PCI_SUB_SEC_BUS, 0xff);

0 commit comments

Comments
 (0)