From f1b8641fd48d573fbedea55eb0e3081f18125d54 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sat, 10 Nov 2018 17:37:01 +0200 Subject: x86: acpi: Enable RTC for Intel Tangier Intel Tangier SoC has RTC inside. So, enable it in ACPI. Signed-off-by: Andy Shevchenko Reviewed-by: Bin Meng --- arch/x86/include/asm/arch-tangier/acpi/platform.asl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/include/asm/arch-tangier/acpi/platform.asl b/arch/x86/include/asm/arch-tangier/acpi/platform.asl index 7abea4bb96e..353b879918a 100644 --- a/arch/x86/include/asm/arch-tangier/acpi/platform.asl +++ b/arch/x86/include/asm/arch-tangier/acpi/platform.asl @@ -21,6 +21,19 @@ Method(_WAK, 1) Return (Package() {0, 0}) } +Scope (_SB) +{ + /* Real Time Clock */ + Device (RTC0) + { + Name (_HID, EisaId ("PNP0B00")) + Name (_CRS, ResourceTemplate() + { + IO(Decode16, 0x70, 0x70, 0x01, 0x08) + }) + } +} + /* ACPI global NVS */ #include "global_nvs.asl" -- cgit v1.2.3 From 73af0601e1d63f54cc9b704e07e9093a35e7d6f1 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sat, 10 Nov 2018 17:37:02 +0200 Subject: x86: acpi: Fix indentation in Intel Tangier ASL code Make the indentation aligned with what used elsewhere in U-Boot. No functional change intended. Signed-off-by: Andy Shevchenko Reviewed-by: Bin Meng --- arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl index 48193ba9570..e166e510cb7 100644 --- a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +++ b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl @@ -295,16 +295,16 @@ Device (PCI0) Method (_CRS, 0, Serialized) { - Name (RBUF, ResourceTemplate () + Name (RBUF, ResourceTemplate() { - UartSerialBus (0x0001C200, DataBitsEight, StopBitsOne, + UartSerialBus(0x0001C200, DataBitsEight, StopBitsOne, 0xFC, LittleEndian, ParityTypeNone, FlowControlHardware, 0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , ) - GpioInt (Level, ActiveHigh, Exclusive, PullNone, 0, + GpioInt(Level, ActiveHigh, Exclusive, PullNone, 0, "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 } - GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly, + GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly, "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 } - GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly, + GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly, "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 } }) Return (RBUF) @@ -328,7 +328,7 @@ Device (FLIS) Name (_DDN, "Intel Merrifield Family-Level Interface Shim") Name (RBUF, ResourceTemplate() { - Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000, ) + Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000) PinGroup("spi5", ResourceProducer, ) { 90, 91, 92, 93, 94, 95, 96 } PinGroup("uart0", ResourceProducer, ) { 115, 116, 117, 118 } PinGroup("uart1", ResourceProducer, ) { 119, 120, 121, 122 } -- cgit v1.2.3 From da4cfa6b442809fc99a6b75255a99eee51a4e13b Mon Sep 17 00:00:00 2001 From: Hannes Schmelzer Date: Sun, 18 Nov 2018 23:19:43 +0100 Subject: x86: make the LAPIC / IOAPIC construct switchable with Kconfig There are still systems running which do not have any LAPIC or even IOAPIC. Responsible MSRs for those do not exist and the systems are crashing on trying to setup LAPIC. This commit makes the APIC stuff able to switch off for those boards which dont' have an LAPIC / IOAPIC. Signed-off-by: Hannes Schmelzer Reviewed-by: Bin Meng --- arch/x86/Kconfig | 9 +++++++++ arch/x86/cpu/Makefile | 2 +- arch/x86/cpu/i386/interrupt.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a1c18d26e1d..8fc9187165c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -736,6 +736,15 @@ config I8259_PIC slave) interrupt controllers. Include this to have U-Boot set up the interrupt correctly. +config APIC + bool + default y + help + The (A)dvanced (P)rogrammable (I)nterrupt (C)ontroller is responsible + for catching interrupts and distributing them to one or more CPU + cores. In most cases there are some LAPICs (local) for each core and + one I/O APIC. This conjunction is found on most modern x86 systems. + config PINCTRL_ICH6 bool help diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile index f862d8c071e..54668aab240 100644 --- a/arch/x86/cpu/Makefile +++ b/arch/x86/cpu/Makefile @@ -35,7 +35,7 @@ obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/ obj-$(CONFIG_INTEL_QUARK) += quark/ obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/ obj-$(CONFIG_INTEL_TANGIER) += tangier/ -obj-y += lapic.o ioapic.o +obj-$(CONFIG_APIC) += lapic.o ioapic.o obj-y += irq.o ifndef CONFIG_$(SPL_)X86_64 obj-$(CONFIG_SMP) += mp_init.o diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c index ed8423e0799..1ea415b876d 100644 --- a/arch/x86/cpu/i386/interrupt.c +++ b/arch/x86/cpu/i386/interrupt.c @@ -264,7 +264,9 @@ int interrupt_init(void) i8259_init(); #endif +#ifdef CONFIG_APIC lapic_setup(); +#endif /* Initialize core interrupt and exception functionality of CPU */ cpu_init_interrupts(); -- cgit v1.2.3 From c641010452a7f651cf77dc0d0f252ef25f1badf0 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 29 Nov 2018 19:57:21 -0800 Subject: x86: Wrap calls to 8259 with CONFIG_I8259_PIC mask_irq(), unmask_irq() and specific_eoi() are provided by the i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC. Signed-off-by: Bin Meng Reviewed-by: Simon Glass Tested-by: Hannes Schmelzer --- arch/x86/lib/interrupts.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index 297067df710..39f8deaed13 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -64,7 +64,8 @@ void irq_install_handler(int irq, interrupt_handler_t *handler, void *arg) irq_handlers[irq].arg = arg; irq_handlers[irq].count = 0; - unmask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + unmask_irq(irq); if (status) enable_interrupts(); @@ -83,7 +84,8 @@ void irq_free_handler(int irq) status = disable_interrupts(); - mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq); irq_handlers[irq].handler = NULL; irq_handlers[irq].arg = NULL; @@ -104,14 +106,16 @@ void do_irq(int hw_irq) } if (irq_handlers[irq].handler) { - mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq); irq_handlers[irq].handler(irq_handlers[irq].arg); irq_handlers[irq].count++; - unmask_irq(irq); - specific_eoi(irq); - + if (CONFIG_IS_ENABLED(I8259_PIC)) { + unmask_irq(irq); + specific_eoi(irq); + } } else { if ((irq & 7) != 7) { spurious_irq_cnt++; -- cgit v1.2.3 From 2677a15e5839ee8f7073192a666348e2e3e5cdcd Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 29 Nov 2018 19:57:22 -0800 Subject: x86: kconfig: Allow board defconfig file to disable 8259 and APIC At present the Kconfig options (CONFIG_I8259_PIC and CONFIG_APIC) do not include a prompt message, which makes it impossible to be disabled from a board defconfig file. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- arch/x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8fc9187165c..e0520937751 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -729,7 +729,7 @@ config PCIE_ECAM_SIZE maximum number of PCI buses as defined by the PCI specification. config I8259_PIC - bool + bool "Enable Intel 8259 compatible interrupt controller" default y help Intel 8259 ISA compatible chipset incorporates two 8259 (master and @@ -737,7 +737,7 @@ config I8259_PIC the interrupt correctly. config APIC - bool + bool "Enable Intel Advanced Programmable Interrupt Controller" default y help The (A)dvanced (P)rogrammable (I)nterrupt (C)ontroller is responsible -- cgit v1.2.3 From f86bd769fd0624106ecd2c5d500518e8b83a4e27 Mon Sep 17 00:00:00 2001 From: Thomas RIENOESSL Date: Thu, 29 Nov 2018 20:07:12 -0800 Subject: coreboot: only init usb if necessary Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as a coreboot payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards. Signed-off-by: Thomas RIENOESSL Reviewed-by: Bin Meng Reviewed-by: Christian Gmeiner --- arch/x86/cpu/coreboot/coreboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index aaf0d071924..4c6ed0bfb28 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -77,7 +77,8 @@ int last_stage_init(void) timestamp_add_to_bootstage(); /* start usb so that usb keyboard can be used as input device */ - usb_init(); + if (CONFIG_IS_ENABLED(USB_KEYBOARD)) + usb_init(); board_final_cleanup(); -- cgit v1.2.3 From d3d6531866f2d7aa85b053cef553090b251e909f Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 29 Nov 2018 20:07:13 -0800 Subject: efi: payload: only init usb if necessary Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as an EFI payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards. Signed-off-by: Bin Meng Reviewed-by: Christian Gmeiner --- arch/x86/cpu/efi/payload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c index c323c7b19a5..225aef7bf6a 100644 --- a/arch/x86/cpu/efi/payload.c +++ b/arch/x86/cpu/efi/payload.c @@ -166,7 +166,8 @@ int reserve_arch(void) int last_stage_init(void) { /* start usb so that usb keyboard can be used as input device */ - usb_init(); + if (CONFIG_IS_ENABLED(USB_KEYBOARD)) + usb_init(); return 0; } -- cgit v1.2.3