| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Conferences | ||
| The coreboot community is present at a number of conferences over the year, | ||
| usually at [FOSDEM](https://fosdem.org), [OSFC](https://osfc.io), and the | ||
| [Chaos Communication Congress](https://events.ccc.de/congress/). | ||
|
|
||
| The kind of presence differs, but there's usually a booth or other kind of | ||
| gathering where everybody is welcome to say hello and to learn more about | ||
| coreboot. | ||
|
|
||
| Depending on the nature of the conference, coreboot developers might bring | ||
| their development kit with them and conduct development sessions. | ||
|
|
||
| ## Upcoming events | ||
|
|
||
| TODO: add them | ||
|
|
||
| ## Talks | ||
|
|
||
| TODO: link to recorded talks |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Our forums | ||
|
|
||
| The coreboot community has various venues to help each other and discuss the | ||
| direction of our project. | ||
|
|
||
| ## Mailing list | ||
|
|
||
| The first address for coreboot related discussion is our mailing list. | ||
| You can subscribe on its | ||
| [information page](https://mail.coreboot.org/postorius/lists/coreboot.coreboot.org/) and | ||
| read its | ||
| [archives](https://mail.coreboot.org/hyperkitty/list/coreboot@coreboot.org/). | ||
|
|
||
| ## IRC | ||
|
|
||
| We also have a | ||
| [real time chat](https://webchat.freenode.net?channels=%23coreboot) | ||
| on the Freenode IRC network's #coreboot channel. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Qemu RISC-V emulator | ||
|
|
||
| ## Building coreboot and running it in Qemu | ||
|
|
||
| - Configure coreboot and run `make` as usual | ||
| - Run `util/riscv/make-spike-elf.sh build/coreboot.rom build/coreboot.elf` to | ||
| convert coreboot to an ELF that Qemu can load | ||
| - Run `qemu-system-riscv64 -M virt -m 1024M -nographic -kernel build/coreboot.elf` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Obtain Hardware Maintenance Manual of ThinkPads | ||
|
|
||
| You are suggested obtain the "Hardware Maintenance Manual" for your corresponding | ||
| model as a guidance. Some can be found from [Hardware Specifications of ThinkWiki]. | ||
|
|
||
| [Hardware Specifications of ThinkWiki]: https://www.thinkwiki.org/wiki/Hardware_Specifications |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Lenovo X1 | ||
|
|
||
| ## Flashing instructions | ||
|
|
||
|  | ||
|
|
||
| You have to remove the keyboard in order to access the flash IC (the chip | ||
| inside the red circle on the picture above), as it is under the wider | ||
| cable (already detached from MB in the picture) connecting the keyboard | ||
| to the mainboard. | ||
|
|
||
| The flash IC can be a SOIC-8 one or a WSON-8 one, and may be covered with | ||
| a piece of insulation tape. | ||
|
|
||
| For more details have a look at [T420 / T520 / X220 / T420s / W520 common] and | ||
|
|
||
| ```eval_rst | ||
| :doc:`../../flash_tutorial/ext_power` | ||
| ``` | ||
|
|
||
| Steps to access the flash IC are described here [X2xx series]. | ||
|
|
||
| [X2xx series]: x2xx_series.md | ||
| [T420 / T520 / X220 / T420s / W520 common]: xx20_series.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Lenovo x2xx series disassembly instructions | ||
|
|
||
| Removing the keyboard and palmrest would allow you to access the flash chip. | ||
|
|
||
| Read their [Hardware Maintenance Manual](thinkpad_hmm.md) for detailed steps. | ||
|
|
||
| ## Steps to access the flash IC | ||
|
|
||
| * Unplug the main battery | ||
| * Remove the keyboard | ||
| * Remove the palmrest | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * This file is part of the coreboot project. | ||
| * | ||
| * Copyright (C) 2016 Google Inc | ||
| * Copyright (C) 2018 HardenedLinux | ||
| * Copyright (C) 2018 Jonathan Neuschäfer | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; version 2 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| */ | ||
|
|
||
| #include <stdint.h> | ||
| #include <arch/boot.h> | ||
| #include <arch/encoding.h> | ||
| #include <console/console.h> | ||
|
|
||
| void run_payload(struct prog *prog, void *fdt, int payload_mode) | ||
| { | ||
| void (*doit)(int hart_id, void *fdt) = prog_entry(prog); | ||
| int hart_id = read_csr(mhartid); | ||
| uintptr_t status = read_csr(mstatus); | ||
| status &= ~MSTATUS_MPIE; | ||
| status &= ~MSTATUS_MPP; | ||
| switch (payload_mode) { | ||
| case RISCV_PAYLOAD_MODE_U: | ||
| break; | ||
| case RISCV_PAYLOAD_MODE_S: | ||
| status |= MSTATUS_SPP; | ||
| break; | ||
| case RISCV_PAYLOAD_MODE_M: | ||
| doit(hart_id, fdt); | ||
| return; | ||
| default: | ||
| die("wrong privilege level for payload"); | ||
| break; | ||
| } | ||
| write_csr(mstatus, status); | ||
| write_csr(mepc, doit); | ||
| asm volatile( | ||
| "mv a0, %0\n\t" | ||
| "mv a1, %0\n\t" | ||
| "mret" ::"r"(hart_id), | ||
| "r"(fdt) | ||
| : "a0", "a1"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
|
|
||
| #include <stdint.h> | ||
| #include <stddef.h> | ||
|
|
||
| /* | ||
| * EFLAGS bits | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ | |
| */ | ||
|
|
||
| #include <random.h> | ||
|
|
||
| /* | ||
| * Intel recommends that applications attempt 10 retries in a tight loop | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 48 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x80000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 36 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x80000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 48 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x100000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 40 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x100000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 48 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x100000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 48 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x100000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ config CPU_ADDR_BITS | |
| int | ||
| default 40 | ||
|
|
||
| config XIP_ROM_SIZE | ||
| hex | ||
| default 0x100000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| config CPU_HAS_L2_ENABLE_MSR | ||
| bool | ||
| help | ||
| Select this in Kconfig of CPU sockets/SOC where the CPU | ||
| has an MSR to enable the L2 CPU cache |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| ramstage-y += common_init.c | ||
| romstage-$(CONFIG_UDELAY_LAPIC) += fsb.c | ||
| ramstage-$(CONFIG_UDELAY_LAPIC) += fsb.c | ||
| postcar-$(CONFIG_UDELAY_LAPIC) += fsb.c | ||
| smm-$(CONFIG_HAVE_SMI_HANDLER) += fsb.c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| * This file is part of the coreboot project. | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; version 2 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| */ | ||
|
|
||
| #include <cpu/cpu.h> | ||
| #include <cpu/x86/msr.h> | ||
| #include <cpu/intel/speedstep.h> | ||
| #include <cpu/intel/fsb.h> | ||
| #include <console/console.h> | ||
| #include <commonlib/helpers.h> | ||
|
|
||
| int get_ia32_fsb(void) | ||
| { | ||
| struct cpuinfo_x86 c; | ||
| static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 }; | ||
| static const short core2_fsb[8] = { 266, 133, 200, 166, 333, 100, 400, -1 }; | ||
| static const short f2x_fsb[8] = { 100, 133, 200, 166, 333, -1, -1, -1 }; | ||
| msr_t msr; | ||
| int ret = -2; | ||
|
|
||
| get_fms(&c, cpuid_eax(1)); | ||
| switch (c.x86) { | ||
| case 0x6: | ||
| switch (c.x86_model) { | ||
| case 0xe: /* Core Solo/Duo */ | ||
| case 0x1c: /* Atom */ | ||
| ret = core_fsb[rdmsr(MSR_FSB_FREQ).lo & 7]; | ||
| break; | ||
| case 0xf: /* Core 2 or Xeon */ | ||
| case 0x17: /* Enhanced Core */ | ||
| ret = core2_fsb[rdmsr(MSR_FSB_FREQ).lo & 7]; | ||
| break; | ||
| case 0x2a: /* SandyBridge BCLK fixed at 100MHz*/ | ||
| case 0x3a: /* IvyBridge BCLK fixed at 100MHz*/ | ||
| case 0x3c: /* Haswell BCLK fixed at 100MHz */ | ||
| case 0x45: /* Haswell-ULT BCLK fixed at 100MHz */ | ||
| ret = 100; | ||
| break; | ||
| } | ||
| break; | ||
| case 0xf: /* Netburst */ | ||
| msr = rdmsr(MSR_EBC_FREQUENCY_ID); | ||
| switch (c.x86_model) { | ||
| case 0x2: | ||
| ret = f2x_fsb[(msr.lo >> 16) & 7]; | ||
| break; | ||
| case 0x3: | ||
| case 0x4: | ||
| case 0x6: | ||
| ret = core2_fsb[(msr.lo >> 16) & 7]; | ||
| break; | ||
| } | ||
| } | ||
| if (ret == -1) | ||
| printk(BIOS_ERR, "FSB not found\n"); | ||
| if (ret == -2) | ||
| printk(BIOS_ERR, "CPU not supported\n"); | ||
| return ret; | ||
| } | ||
|
|
||
| /** | ||
| * @brief Returns three times the FSB clock in MHz | ||
| * | ||
| * The result of calculations with the returned value shall be divided by 3. | ||
| * This helps to avoid rounding errors. | ||
| */ | ||
| int get_ia32_fsb_x3(void) | ||
| { | ||
| const int fsb = get_ia32_fsb(); | ||
|
|
||
| if (fsb > 0) | ||
| return 100 * DIV_ROUND_CLOSEST(3 * fsb, 100); | ||
|
|
||
| printk(BIOS_ERR, "FSB not supported or not found\n"); | ||
| return -1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| config MICROCODE_UPDATE_PRE_RAM | ||
| bool | ||
| depends on SUPPORT_CPU_UCODE_IN_CBFS | ||
| default y if C_ENVIRONMENT_BOOTBLOCK | ||
| help | ||
| Select this option if you want to update the microcode | ||
| during the cache as ram setup. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,5 @@ | ||
| bootblock-$(CONFIG_MICROCODE_UPDATE_PRE_RAM) += microcode_asm.S | ||
| romstage-$(CONFIG_MICROCODE_UPDATE_PRE_RAM) += microcode_asm.S | ||
|
|
||
| ramstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += microcode.c | ||
| romstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += microcode.c | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| /* | ||
| * This file is part of the coreboot project. | ||
| * | ||
| * Copyright (C) 2007-2009 coresystems GmbH | ||
| * 2012 secunet Security Networks AG | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public License as | ||
| * published by the Free Software Foundation; version 2 of | ||
| * the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| */ | ||
|
|
||
| #include <console/console.h> | ||
| #include <cpu/x86/mtrr.h> | ||
| #include <cpu/x86/mp.h> | ||
| #include <cpu/intel/microcode.h> | ||
| #include <cpu/intel/smm/gen1/smi.h> | ||
| #include <cpu/intel/common/common.h> | ||
|
|
||
| /* Parallel MP initialization support. */ | ||
| static const void *microcode_patch; | ||
|
|
||
| static void pre_mp_init(void) | ||
| { | ||
| /* Setup MTRRs based on physical address size. */ | ||
| x86_setup_mtrrs_with_detect(); | ||
| x86_mtrr_check(); | ||
| } | ||
|
|
||
| static int get_cpu_count(void) | ||
| { | ||
| const struct cpuid_result cpuid1 = cpuid(1); | ||
| const char cores = (cpuid1.ebx >> 16) & 0xf; | ||
|
|
||
| printk(BIOS_DEBUG, "CPU has %u cores.\n", cores); | ||
|
|
||
| return cores; | ||
| } | ||
|
|
||
| /* the SMRR enable and lock bit need to be set in IA32_FEATURE_CONTROL | ||
| to enable SMRR so configure IA32_FEATURE_CONTROL early on */ | ||
| static void pre_mp_smm_init(void) | ||
| { | ||
| smm_initialize(); | ||
| } | ||
|
|
||
| #define SMRR_SUPPORTED (1 << 11) | ||
|
|
||
| static void per_cpu_smm_trigger(void) | ||
| { | ||
| msr_t mtrr_cap = rdmsr(MTRR_CAP_MSR); | ||
| if (cpu_has_alternative_smrr() && mtrr_cap.lo & SMRR_SUPPORTED) { | ||
| set_feature_ctrl_vmx(); | ||
| msr_t ia32_ft_ctrl = rdmsr(IA32_FEATURE_CONTROL); | ||
| /* We don't care if the lock is already setting | ||
| as our smm relocation handler is able to handle | ||
| setups where SMRR is not enabled here. */ | ||
| if (!IS_ENABLED(CONFIG_SET_IA32_FC_LOCK_BIT)) | ||
| printk(BIOS_INFO, | ||
| "Overriding CONFIG_SET_IA32_FC_LOCK_BIT to enable SMRR\n"); | ||
| ia32_ft_ctrl.lo |= (1 << 3) | (1 << 0); | ||
| wrmsr(IA32_FEATURE_CONTROL, ia32_ft_ctrl); | ||
| } else { | ||
| set_vmx_and_lock(); | ||
| } | ||
|
|
||
| /* Relocate the SMM handler. */ | ||
| smm_relocate(); | ||
|
|
||
| /* After SMM relocation a 2nd microcode load is required. */ | ||
| intel_microcode_load_unlocked(microcode_patch); | ||
| } | ||
|
|
||
| static void post_mp_init(void) | ||
| { | ||
| /* Now that all APs have been relocated as well as the BSP let SMIs | ||
| * start flowing. */ | ||
| southbridge_smm_init(); | ||
|
|
||
| /* Lock down the SMRAM space. */ | ||
| smm_lock(); | ||
| } | ||
|
|
||
| static const struct mp_ops mp_ops = { | ||
| .pre_mp_init = pre_mp_init, | ||
| .get_cpu_count = get_cpu_count, | ||
| .get_smm_info = smm_info, | ||
| .pre_mp_smm_init = pre_mp_smm_init, | ||
| .per_cpu_smm_trigger = per_cpu_smm_trigger, | ||
| .relocation_handler = smm_relocation_handler, | ||
| .post_mp_init = post_mp_init, | ||
| }; | ||
|
|
||
| void bsp_init_and_start_aps(struct bus *cpu_bus) | ||
| { | ||
| if (mp_init_with_smm(cpu_bus, &mp_ops)) | ||
| printk(BIOS_ERR, "MP initialization failure.\n"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| ramstage-y += model_6fx_init.c | ||
| subdirs-y += ../../x86/name | ||
| subdirs-y += ../common | ||
| ramstage-$(CONFIG_PARALLEL_MP) += ../model_1067x/mp_init.c | ||
| subdirs-$(CONFIG_SMM_TSEG) += ../smm/gen1 | ||
|
|
||
| cpu_microcode_bins += 3rdparty/blobs/cpu/intel/model_6fx/microcode.bin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| ramstage-y += model_6xx_init.c | ||
|
|
||
| cpu_microcode_bins += 3rdparty/blobs/cpu/intel/model_66x/microcode.bin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| ramstage-y += model_f3x_init.c | ||
| subdirs-$(CONFIG_SMM_TSEG) += ../smm/gen1 | ||
| ramstage-$(CONFIG_PARALLEL_MP) += ../model_1067x/mp_init.c | ||
|
|
||
| cpu_microcode_bins += 3rdparty/blobs/cpu/intel/model_f3x/microcode.bin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| ramstage-y += model_f4x_init.c | ||
| subdirs-$(CONFIG_SMM_TSEG) += ../smm/gen1 | ||
| ramstage-$(CONFIG_PARALLEL_MP) += ../model_1067x/mp_init.c | ||
|
|
||
| cpu_microcode_bins += 3rdparty/blobs/cpu/intel/model_f4x/microcode.bin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| gdtptr16_offset = gdtptr16 & 0xffff; | ||
| nullidt_offset = nullidt & 0xffff; | ||
| ap_sipi_vector_in_rom = (_start16bit >> 12) & 0xff; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ | |
|
|
||
| #include <arch/rom_segs.h> | ||
| #include <cpu/x86/post_code.h> | ||
| #include <arch/x86/gdt_init.S> | ||
|
|
||
| .code32 | ||
|
|
||