|
| 1 | +From 38b2cb092e866dede6b6ffddd135ff54a9bda69e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Angel Pons < [email protected]> |
| 3 | +Date: Wed, 2 Nov 2022 22:45:52 +0100 |
| 4 | +Subject: [PATCH] sb600spi.c: Drop "Promontory" support |
| 5 | + |
| 6 | +The "Promontory" code is riddled with issues, some of them can result in |
| 7 | +soft bricks. Moreover, Promontory doesn't have a SPI controller. |
| 8 | + |
| 9 | +Drop support for "Promontory" in flashrom for now: it's holding back the |
| 10 | +entire project and it's unlikely that it'll be fixed in a timely manner. |
| 11 | + |
| 12 | +Change-Id: I1457946dce68321b496d9ffa40a0c5ab46455f72 |
| 13 | +Signed-off-by: Angel Pons < [email protected]> |
| 14 | +Reviewed-on: https://review.coreboot.org/c/flashrom/+/68824 |
| 15 | +Tested-by: build bot (Jenkins) < [email protected]> |
| 16 | +Reviewed-by: Felix Singer < [email protected]> |
| 17 | +Reviewed-by: Swift Geek (Sebastian Grzywna) < [email protected]> |
| 18 | +Reviewed-by: Edward O'Callaghan < [email protected]> |
| 19 | +(cherry picked from commit 664c58f32af45b2acf7520c05bb40ef2c2f0891e) |
| 20 | +--- |
| 21 | + sb600spi.c | 31 ++----------------------------- |
| 22 | + 1 file changed, 2 insertions(+), 29 deletions(-) |
| 23 | + |
| 24 | +diff --git a/sb600spi.c b/sb600spi.c |
| 25 | +index cec7e0a5..e84bb8d6 100644 |
| 26 | +--- a/sb600spi.c |
| 27 | ++++ b/sb600spi.c |
| 28 | +@@ -48,7 +48,6 @@ enum amd_chipset { |
| 29 | + CHIPSET_HUDSON234, |
| 30 | + CHIPSET_BOLTON, |
| 31 | + CHIPSET_YANGTZE, |
| 32 | +- CHIPSET_PROMONTORY, |
| 33 | + }; |
| 34 | + |
| 35 | + #define FIFO_SIZE_OLD 8 |
| 36 | +@@ -135,7 +134,8 @@ static enum amd_chipset determine_generation(struct pci_dev *dev) |
| 37 | + */ |
| 38 | + } else if (rev == 0x4b || rev == 0x51 || rev == 0x59 || rev == 0x61 || rev == 0x71) { |
| 39 | + msg_pdbg("Promontory (rev 0x%02x) detected.\n", rev); |
| 40 | +- return CHIPSET_PROMONTORY; |
| 41 | ++ msg_perr("AMD \"Promontory\" chipsets are currently not supported (https://ticket.coreboot.org/issues/370)"); |
| 42 | ++ return CHIPSET_AMD_UNKNOWN; |
| 43 | + } else { |
| 44 | + msg_pwarn("FCH device found but SMBus revision 0x%02x does not match known values.\n" |
| 45 | + "Please report this to [email protected] and include this log and\n" |
| 46 | +@@ -572,18 +572,6 @@ static int handle_imc(const struct programmer_cfg *cfg, struct pci_dev *dev, enu |
| 47 | + return amd_imc_shutdown(dev); |
| 48 | + } |
| 49 | + |
| 50 | +-static int promontory_read_memmapped(struct flashctx *flash, uint8_t *buf, |
| 51 | +- unsigned int start, unsigned int len) |
| 52 | +-{ |
| 53 | +- struct sb600spi_data * data = (struct sb600spi_data *)flash->mst->spi.data; |
| 54 | +- if (!data->flash) { |
| 55 | +- map_flash(flash); |
| 56 | +- data->flash = flash; /* keep a copy of flashctx for unmap() on tear-down. */ |
| 57 | +- } |
| 58 | +- mmio_readn((void *)(flash->virtual_memory + start), buf, len); |
| 59 | +- return 0; |
| 60 | +-} |
| 61 | +- |
| 62 | + static int sb600spi_shutdown(void *data) |
| 63 | + { |
| 64 | + struct sb600spi_data *sb600_data = data; |
| 65 | +@@ -617,17 +605,6 @@ static const struct spi_master spi_master_yangtze = { |
| 66 | + .shutdown = sb600spi_shutdown, |
| 67 | + }; |
| 68 | + |
| 69 | +-static const struct spi_master spi_master_promontory = { |
| 70 | +- .max_data_read = MAX_DATA_READ_UNLIMITED, |
| 71 | +- .max_data_write = FIFO_SIZE_YANGTZE - 3, |
| 72 | +- .command = spi100_spi_send_command, |
| 73 | +- .map_flash_region = physmap, |
| 74 | +- .unmap_flash_region = physunmap, |
| 75 | +- .read = promontory_read_memmapped, |
| 76 | +- .write_256 = default_spi_write_256, |
| 77 | +- .shutdown = sb600spi_shutdown, |
| 78 | +-}; |
| 79 | +- |
| 80 | + int sb600_probe_spi(const struct programmer_cfg *cfg, struct pci_dev *dev) |
| 81 | + { |
| 82 | + struct pci_dev *smbus_dev; |
| 83 | +@@ -731,8 +708,6 @@ int sb600_probe_spi(const struct programmer_cfg *cfg, struct pci_dev *dev) |
| 84 | + case CHIPSET_SB89XX: |
| 85 | + case CHIPSET_HUDSON234: |
| 86 | + case CHIPSET_YANGTZE: |
| 87 | +- case CHIPSET_PROMONTORY: |
| 88 | +- msg_pdbg(", SpiBusy=%"PRIi32"", (tmp >> 31) & 0x1); |
| 89 | + default: break; |
| 90 | + } |
| 91 | + msg_pdbg("\n"); |
| 92 | +@@ -808,8 +783,6 @@ int sb600_probe_spi(const struct programmer_cfg *cfg, struct pci_dev *dev) |
| 93 | + register_spi_master(&spi_master_sb600, data); |
| 94 | + else if (amd_gen == CHIPSET_YANGTZE) |
| 95 | + register_spi_master(&spi_master_yangtze, data); |
| 96 | +- else |
| 97 | +- register_spi_master(&spi_master_promontory, data); |
| 98 | + |
| 99 | + return 0; |
| 100 | + } |
| 101 | +-- |
| 102 | +2.45.2 |
| 103 | + |
0 commit comments