summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/apollolake
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-23 18:11:30 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:24:41 +0300
commit8b842be10c2d40437b1f24a8dce8718c33045376 (patch)
treed92e428e1be0982f160823d685b9feb218cece85 /arch/x86/cpu/apollolake
parent5e89be1efd4fb4633875f99b1dbe095ff4787c98 (diff)
downloadu-boot-8b842be10c2d40437b1f24a8dce8718c33045376.tar.xz
x86: apl: Reduce size for TPL
Update various drivers to use of_match_ptr() and to avoid including debug strings in TPL. Omit the WiFi driver entirely, since it is not used in TPL. This reduces the TPL binary size by about 608 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/apollolake')
-rw-r--r--arch/x86/cpu/apollolake/lpc.c13
-rw-r--r--arch/x86/cpu/apollolake/pch.c4
-rw-r--r--arch/x86/cpu/apollolake/pmc.c4
-rw-r--r--arch/x86/cpu/apollolake/uart.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/arch/x86/cpu/apollolake/lpc.c b/arch/x86/cpu/apollolake/lpc.c
index d8e05f6a8f..e085890d63 100644
--- a/arch/x86/cpu/apollolake/lpc.c
+++ b/arch/x86/cpu/apollolake/lpc.c
@@ -81,10 +81,11 @@ int lpc_open_pmio_window(uint base, uint size)
lgir_reg_num = find_unused_pmio_window();
if (lgir_reg_num < 0) {
- log_err("LPC: Cannot open IO window: %lx size %lx\n",
- bridge_base, size - bridged_size);
- log_err("No more IO windows\n");
-
+ if (spl_phase() > PHASE_TPL) {
+ log_err("LPC: Cannot open IO window: %lx size %lx\n",
+ bridge_base, size - bridged_size);
+ log_err("No more IO windows\n");
+ }
return -ENOSPC;
}
lgir_reg_offset = LPC_GENERIC_IO_RANGE(lgir_reg_num);
@@ -127,15 +128,17 @@ struct acpi_ops apl_lpc_acpi_ops = {
.inject_dsdt = southbridge_inject_dsdt,
};
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id apl_lpc_ids[] = {
{ .compatible = "intel,apl-lpc" },
{ }
};
+#endif
/* All pads are LPC already configured by the hostbridge, so no probing here */
U_BOOT_DRIVER(intel_apl_lpc) = {
.name = "intel_apl_lpc",
.id = UCLASS_LPC,
- .of_match = apl_lpc_ids,
+ .of_match = of_match_ptr(apl_lpc_ids),
ACPI_OPS_PTR(&apl_lpc_acpi_ops)
};
diff --git a/arch/x86/cpu/apollolake/pch.c b/arch/x86/cpu/apollolake/pch.c
index d9832ff249..39d6ad5ed4 100644
--- a/arch/x86/cpu/apollolake/pch.c
+++ b/arch/x86/cpu/apollolake/pch.c
@@ -23,14 +23,16 @@ static const struct pch_ops apl_pch_ops = {
.set_spi_protect = apl_set_spi_protect,
};
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id apl_pch_ids[] = {
{ .compatible = "intel,apl-pch" },
{ }
};
+#endif
U_BOOT_DRIVER(intel_apl_pch) = {
.name = "intel_apl_pch",
.id = UCLASS_PCH,
- .of_match = apl_pch_ids,
+ .of_match = of_match_ptr(apl_pch_ids),
.ops = &apl_pch_ops,
};
diff --git a/arch/x86/cpu/apollolake/pmc.c b/arch/x86/cpu/apollolake/pmc.c
index c40065ab8c..e033baf120 100644
--- a/arch/x86/cpu/apollolake/pmc.c
+++ b/arch/x86/cpu/apollolake/pmc.c
@@ -212,15 +212,17 @@ static const struct acpi_pmc_ops apl_pmc_ops = {
.global_reset_set_enable = apl_global_reset_set_enable,
};
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id apl_pmc_ids[] = {
{ .compatible = "intel,apl-pmc" },
{ }
};
+#endif
U_BOOT_DRIVER(intel_apl_pmc) = {
.name = "intel_apl_pmc",
.id = UCLASS_ACPI_PMC,
- .of_match = apl_pmc_ids,
+ .of_match = of_match_ptr(apl_pmc_ids),
.of_to_plat = apl_pmc_ofdata_to_uc_plat,
.probe = apl_pmc_probe,
.ops = &apl_pmc_ops,
diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
index e523d85b1b..69e5899235 100644
--- a/arch/x86/cpu/apollolake/uart.c
+++ b/arch/x86/cpu/apollolake/uart.c
@@ -118,15 +118,17 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
return 0;
}
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id apl_ns16550_serial_ids[] = {
{ .compatible = "intel,apl-ns16550" },
{ },
};
+#endif
U_BOOT_DRIVER(intel_apl_ns16550) = {
.name = "intel_apl_ns16550",
.id = UCLASS_SERIAL,
- .of_match = apl_ns16550_serial_ids,
+ .of_match = of_match_ptr(apl_ns16550_serial_ids),
.plat_auto = sizeof(struct ns16550_plat),
.priv_auto = sizeof(struct ns16550),
.ops = &ns16550_serial_ops,