diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-23 08:11:29 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:41 -0700 |
commit | 5e89be1efd4fb4633875f99b1dbe095ff4787c98 (patch) | |
tree | 8693e28d29afe492c6a2bc256e29f0c0fe84a0ad | |
parent | 1d2b8585f6c58f786f52dbd770b346a8386b0d41 (diff) | |
download | u-boot-5e89be1efd4fb4633875f99b1dbe095ff4787c98.tar.gz u-boot-5e89be1efd4fb4633875f99b1dbe095ff4787c98.tar.bz2 u-boot-5e89be1efd4fb4633875f99b1dbe095ff4787c98.zip |
x86: apl: Update hostbridge to remove unwanted TPL code
At present several strings from this file appear in the TPL binary. Add
preprocessor checks to drop them.
This reduces the TPL binary size by about 128 bytes.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/x86/cpu/apollolake/hostbridge.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/cpu/apollolake/hostbridge.c b/arch/x86/cpu/apollolake/hostbridge.c index e4674f3788..9ec2309d08 100644 --- a/arch/x86/cpu/apollolake/hostbridge.c +++ b/arch/x86/cpu/apollolake/hostbridge.c @@ -60,6 +60,7 @@ struct apl_hostbridge_plat { pci_dev_t bdf; }; +#if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) static const struct nhlt_format_config dmic_1ch_formats[] = { /* 48 KHz 16-bits per sample. */ { @@ -155,6 +156,7 @@ static const struct nhlt_endp_descriptor dmic_4ch_descriptors[] = { .num_formats = ARRAY_SIZE(dmic_4ch_formats), }, }; +#endif static int apl_hostbridge_early_init_pinctrl(struct udevice *dev) { @@ -283,7 +285,7 @@ static int apl_acpi_hb_get_name(const struct udevice *dev, char *out_name) return acpi_copy_name(out_name, "RHUB"); } -#ifdef CONFIG_GENERATE_ACPI_TABLE +#if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) static int apl_acpi_hb_write_tables(const struct udevice *dev, struct acpi_ctx *ctx) { @@ -322,7 +324,6 @@ static int apl_acpi_hb_write_tables(const struct udevice *dev, return 0; } -#endif static int apl_acpi_setup_nhlt(const struct udevice *dev, struct acpi_ctx *ctx) { @@ -347,6 +348,7 @@ static int apl_acpi_setup_nhlt(const struct udevice *dev, struct acpi_ctx *ctx) return log_msg_ret("channels", -EINVAL); } +#endif static int apl_hostbridge_remove(struct udevice *dev) { @@ -385,21 +387,23 @@ ulong sa_get_tseg_base(struct udevice *dev) struct acpi_ops apl_hostbridge_acpi_ops = { .get_name = apl_acpi_hb_get_name, -#ifdef CONFIG_GENERATE_ACPI_TABLE +#if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) .write_tables = apl_acpi_hb_write_tables, -#endif .setup_nhlt = apl_acpi_setup_nhlt, +#endif }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_hostbridge_ids[] = { { .compatible = "intel,apl-hostbridge" }, { } }; +#endif U_BOOT_DRIVER(intel_apl_hostbridge) = { .name = "intel_apl_hostbridge", .id = UCLASS_NORTHBRIDGE, - .of_match = apl_hostbridge_ids, + .of_match = of_match_ptr(apl_hostbridge_ids), .of_to_plat = apl_hostbridge_of_to_plat, .probe = apl_hostbridge_probe, .remove = apl_hostbridge_remove, |