mail.coreboot.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

coreboot-gerrit

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2013 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
coreboot-gerrit@coreboot.org

April 2013

  • 1 participants
  • 506 discussions
Patch set updated for coreboot: e99c70b boot state: schedule static callbacks
by Aaron Durbin April 26, 2013

April 26, 2013
Aaron Durbin (adurbin(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3133 -gerrit commit e99c70b8e4138b10b460e692ee76d2cd876c0af2 Author: Aaron Durbin <adurbin(a)chromium.org> Date: Wed Apr 24 16:12:52 2013 -0500 boot state: schedule static callbacks Many of the boot state callbacks can be scheduled at compile time. Therefore, provide a way for a compilation unit to inform the boot state machine when its callbacks should be called. Each C module can export the callbacks and their scheduling requirements without changing the shared boot flow code. Change-Id: Ibc4cea4bd5ad45b2149c2d4aa91cbea652ed93ed Signed-off-by: Aaron Durbin <adurbin(a)chromium.org> --- src/arch/armv7/coreboot_ram.ld | 3 +++ src/arch/x86/coreboot_ram.ld | 3 +++ src/include/bootstate.h | 21 +++++++++++++++++++++ src/lib/hardwaremain.c | 20 ++++++++++++++++++++ src/lib/rmodule.ld | 4 ++++ 5 files changed, 51 insertions(+) diff --git a/src/arch/armv7/coreboot_ram.ld b/src/arch/armv7/coreboot_ram.ld index c2ead7a..487f610 100644 --- a/src/arch/armv7/coreboot_ram.ld +++ b/src/arch/armv7/coreboot_ram.ld @@ -61,6 +61,9 @@ SECTIONS cpu_drivers = . ; *(.rodata.cpu_driver) ecpu_drivers = . ; + _bs_init_begin = .; + *(.bs_init) + _bs_init_end = .; *(.rodata) *(.rodata.*) /* kevinh/Ispiri - Added an align, because the objcopy tool diff --git a/src/arch/x86/coreboot_ram.ld b/src/arch/x86/coreboot_ram.ld index 2dd51d5..ea32837 100644 --- a/src/arch/x86/coreboot_ram.ld +++ b/src/arch/x86/coreboot_ram.ld @@ -64,6 +64,9 @@ SECTIONS cpu_drivers = . ; *(.rodata.cpu_driver) ecpu_drivers = . ; + _bs_init_begin = .; + *(.bs_init) + _bs_init_end = .; *(.rodata) *(.rodata.*) diff --git a/src/include/bootstate.h b/src/include/bootstate.h index a2eacfb..d11d2e7 100644 --- a/src/include/bootstate.h +++ b/src/include/bootstate.h @@ -158,4 +158,25 @@ int boot_state_sched_on_exit(struct boot_state_callback *bscb, /* Entry into the boot state machine. */ void hardwaremain(int boot_complete); +/* In order to schedule boot state callbacks at compile-time specify the + * entries in an array using the BOOT_STATE_INIT_ENTRIES and + * BOOT_STATE_INIT_ENTRY macros below. */ +struct boot_state_init_entry { + boot_state_t state; + boot_state_sequence_t when; + struct boot_state_callback bscb; +}; + +#define BOOT_STATE_INIT_ATTR __attribute__ ((section (".bs_init"))) + +#define BOOT_STATE_INIT_ENTRIES(name_) \ + struct boot_state_init_entry name_[] BOOT_STATE_INIT_ATTR + +#define BOOT_STATE_INIT_ENTRY(state_, when_, func_, arg_) \ + { \ + .state = state_, \ + .when = when_, \ + .bscb = BOOT_STATE_CALLBACK_INIT(func_, arg_), \ + } + #endif /* BOOTSTATE_H */ diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index dba47a7..0a5a522 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -293,6 +293,23 @@ int boot_state_sched_on_exit(struct boot_state_callback *bscb, return boot_state_sched_callback(state, bscb, BS_ON_EXIT); } +static void boot_state_schedule_static_entries(void) +{ + extern struct boot_state_init_entry _bs_init_begin; + extern struct boot_state_init_entry _bs_init_end; + struct boot_state_init_entry *cur; + + cur = &_bs_init_begin; + + while (cur != &_bs_init_end) { + if (cur->when == BS_ON_ENTRY) + boot_state_sched_on_entry(&cur->bscb, cur->state); + else + boot_state_sched_on_exit(&cur->bscb, cur->state); + cur++; + } +} + void hardwaremain(int boot_complete) { timestamp_stash(TS_START_RAMSTAGE); @@ -318,6 +335,9 @@ void hardwaremain(int boot_complete) hard_reset(); } + /* Schedule the static boot state entries. */ + boot_state_schedule_static_entries(); + /* FIXME: Is there a better way to handle this? */ init_timer(); diff --git a/src/lib/rmodule.ld b/src/lib/rmodule.ld index 41d6357..43c0718 100644 --- a/src/lib/rmodule.ld +++ b/src/lib/rmodule.ld @@ -61,6 +61,10 @@ SECTIONS cpu_drivers = . ; *(.rodata.cpu_driver) ecpu_drivers = . ; + _bs_init_begin = .; + *(.bs_init) + _bs_init_end = .; + . = ALIGN(4); *(.rodata);
1 0
0 0
Patch set updated for coreboot: 068b03d coverage: use boot state callbacks
by Aaron Durbin April 26, 2013

April 26, 2013
Aaron Durbin (adurbin(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3135 -gerrit commit 068b03d9b072fdf0b86dadf1d2777798d1e46219 Author: Aaron Durbin <adurbin(a)chromium.org> Date: Wed Apr 24 16:28:52 2013 -0500 coverage: use boot state callbacks Utilize the static boot state callback scheduling to initialize and tear down the coverage infrastructure at the appropriate points. The coverage initialization is performed at BS_PRE_DEVICE which is the earliest point a callback can be called. The tear down occurs at the 2 exit points of ramstage: OS resume and payload boot. Change-Id: Ie5ee51268e1f473f98fa517710a266e38dc01b6d Signed-off-by: Aaron Durbin <adurbin(a)chromium.org> --- src/arch/x86/boot/acpi.c | 4 ---- src/include/coverage.h | 21 --------------------- src/lib/gcov-glue.c | 12 ++++++++---- src/lib/hardwaremain.c | 5 ----- src/lib/selfboot.c | 4 ---- 5 files changed, 8 insertions(+), 38 deletions(-) diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index 1c373ac..a3bf718 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -36,7 +36,6 @@ #if CONFIG_COLLECT_TIMESTAMPS #include <timestamp.h> #endif -#include <coverage.h> /* FIXME: Kconfig doesn't support overridable defaults :-( */ #ifndef CONFIG_HPET_MIN_TICKS @@ -638,9 +637,6 @@ void acpi_resume(void *wake_vec) /* Call mainboard resume handler first, if defined. */ if (mainboard_suspend_resume) mainboard_suspend_resume(); -#if CONFIG_COVERAGE - coverage_exit(); -#endif /* Tear down the caching of the ROM. */ if (disable_cache_rom) disable_cache_rom(); diff --git a/src/include/coverage.h b/src/include/coverage.h deleted file mode 100644 index e1c50c5..0000000 --- a/src/include/coverage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2012 Google, Inc. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA - */ - -void coverage_init(void); -void coverage_exit(void); diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c index 4e2b290..ab9062b 100644 --- a/src/lib/gcov-glue.c +++ b/src/lib/gcov-glue.c @@ -18,8 +18,8 @@ */ #include <stdint.h> +#include <bootstate.h> #include <cbmem.h> -#include <coverage.h> typedef struct file { uint32_t magic; @@ -128,7 +128,7 @@ static void setbuf(FILE *stream, char *buf) gcc_assert(buf == 0); } -void coverage_init(void) +static void coverage_init(void *unused) { extern long __CTOR_LIST__; typedef void (*func_ptr)(void) ; @@ -142,7 +142,7 @@ void coverage_init(void) } void __gcov_flush(void); -void coverage_exit(void) +static void coverage_exit(void *unused) { #if CONFIG_DEBUG_COVERAGE printk(BIOS_DEBUG, "Syncing coverage data.\n"); @@ -150,4 +150,8 @@ void coverage_exit(void) __gcov_flush(); } - +BOOT_STATE_INIT_ENTRIES(gcov_bscb) = { + BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, coverage_init, NULL), + BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, coverage_exit, NULL), + BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, coverage_exit, NULL), +}; diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index d8b9d43..e4b2659 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -38,7 +38,6 @@ #include <arch/acpi.h> #endif #include <cbmem.h> -#include <coverage.h> #include <timestamp.h> #if BOOT_STATE_DEBUG @@ -331,10 +330,6 @@ void hardwaremain(int boot_complete) timestamp_stash(TS_START_RAMSTAGE); post_code(POST_ENTRY_RAMSTAGE); -#if CONFIG_COVERAGE - coverage_init(); -#endif - /* console_init() MUST PRECEDE ALL printk()! */ console_init(); diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index be03b85..934c131 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -33,7 +33,6 @@ #if CONFIG_COLLECT_TIMESTAMPS #include <timestamp.h> #endif -#include <coverage.h> /* Maximum physical address we can use for the coreboot bounce buffer. */ #ifndef MAX_ADDR @@ -537,9 +536,6 @@ int selfboot(struct lb_memory *mem, struct cbfs_payload *payload) #if CONFIG_COLLECT_TIMESTAMPS timestamp_add_now(TS_SELFBOOT_JUMP); #endif -#if CONFIG_COVERAGE - coverage_exit(); -#endif /* Tear down the caching of the ROM. */ if (disable_cache_rom)
1 0
0 0
Patch merged into coreboot/master: 526a46e Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2
by gerrit@coreboot.org April 26, 2013

April 26, 2013
the following patch was just integrated into master: commit 526a46ed7e4feb9e2cb02dffccbf40182c8cc014 Author: Paul Menzel <paulepanter(a)users.sourceforge.net> Date: Tue Apr 23 13:00:34 2013 +0200 Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2 Commit »Support for the Intel ICH7 southbridge.« (debb11fc) [1] used `1 << 25` to set the I/O APIC ID of 2. Instead using `2 << 24`, which is the same value, makes it clear, that the I/O APIC ID is 2. Commit »Intel Panther Point PCH: Use 2 << 24 to clarify that APIC ID is 2« (8c937c7e) [2] is used as a template. [1] http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=debb11fc1fe5f55… [2] http://review.coreboot.org/3100 Change-Id: Ib688500944cd78a1cc1c8082bb138fa9468bdbfb Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net> Reviewed-on: http://review.coreboot.org/3122 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com> Build-Tested: build bot (Jenkins) at Fri Apr 26 17:48:31 2013, giving +1 Reviewed-By: Ronald G. Minnich <rminnich(a)gmail.com> at Fri Apr 26 18:36:58 2013, giving +2 See http://review.coreboot.org/3122 for details. -gerrit
1 0
0 0
Patch set updated for coreboot: 8896f4b google/snow: Revise romstage initialization code.
by Paul Menzel April 26, 2013

April 26, 2013
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3130 -gerrit commit 8896f4be1077a8bfdeeb482dcad8d5806325397b Author: Hung-Te Lin <hungte(a)chromium.org> Date: Thu Apr 25 19:30:19 2013 +0800 google/snow: Revise romstage initialization code. Move board setup procedure to snow_setup_* functions, and Snow board-specific (wakeup) code to snow_* for better function names and comments. Verified by successfully building and booting on Google/Snow. Change-Id: I2942d75064135093eeb1c1da188a005fd255111d Signed-off-by: Hung-Te Lin <hungte(a)chromium.org> --- src/mainboard/google/snow/mainboard.h | 10 ++-- src/mainboard/google/snow/romstage.c | 92 ++++++++++++++++++----------------- src/mainboard/google/snow/wakeup.c | 14 +++--- 3 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/mainboard/google/snow/mainboard.h b/src/mainboard/google/snow/mainboard.h index 63a2c18..5060b72 100644 --- a/src/mainboard/google/snow/mainboard.h +++ b/src/mainboard/google/snow/mainboard.h @@ -36,14 +36,14 @@ enum snow_board_config { int board_get_config(void); enum { - BOARD_IS_NOT_WAKEUP, // A normal boot (not suspend/resume). - BOARD_WAKEUP_DIRECT, // A wake up event that can be resumed any time. - BOARD_WAKEUP_NEED_CLOCK_RESET, // A wake up event that must be resumed + SNOW_IS_NOT_WAKEUP, // A normal boot (not suspend/resume). + SNOW_WAKEUP_DIRECT, // A wake up event that can be resumed any time. + SNOW_WAKEUP_NEED_CLOCK_RESET, // A wake up event that must be resumed // only after clock and memory // controllers are re-initialized. }; -int board_get_wakeup_state(void); -void board_wakeup(void); +int snow_get_wakeup_state(void); +void snow_wakeup(void); #endif /* MAINBOARD_H */ diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index 6e312fa..fd5cfce 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -46,10 +46,16 @@ #define PMIC_BUS 0 #define MMC0_GPIO_PIN (58) -static int setup_pmic(void) +static void snow_setup_power(void) { int error = 0; + power_init(); + + /* Initialize I2C bus to configure PMIC. */ + i2c_init(0, CONFIG_SYS_I2C_SPEED, 0x00); + + printk(BIOS_DEBUG, "%s: Setting up PMIC...\n", __func__); /* * We're using CR1616 coin cell battery that is non-rechargeable * battery. But, BBCHOSTEN bit of the BBAT Charger Register in @@ -81,19 +87,19 @@ static int setup_pmic(void) error |= max77686_enable_32khz_cp(PMIC_BUS); - if (error) - printk(BIOS_CRIT, "%s: Error during PMIC setup\n", __func__); - - return error; + if (error) { + printk(BIOS_CRIT, "%s: PMIC error: %#x\n", __func__, error); + die("Failed to intialize PMIC.\n"); + } } -static void initialize_s5p_mshc(void) +static void snow_setup_storage(void) { /* MMC0: Fixed, 8 bit mode, connected with GPIO. */ if (clock_set_mshci(PERIPH_ID_SDMMC0)) - printk(BIOS_CRIT, "Failed to set clock for SDMMC0.\n"); + printk(BIOS_CRIT, "%s: Failed to set MMC0 clock.\n", __func__); if (gpio_direction_output(MMC0_GPIO_PIN, 1)) { - printk(BIOS_CRIT, "Unable to power on SDMMC0.\n"); + printk(BIOS_CRIT, "%s: Unable to power on MMC0.\n", __func__); } gpio_set_pull(MMC0_GPIO_PIN, EXYNOS_GPIO_PULL_NONE); gpio_set_drv(MMC0_GPIO_PIN, EXYNOS_GPIO_DRV_4X); @@ -104,12 +110,12 @@ static void initialize_s5p_mshc(void) exynos_pinmux_config(PERIPH_ID_SDMMC2, 0); } -static void graphics(void) +static void snow_setup_graphics(void) { exynos_pinmux_config(PERIPH_ID_DPHPD, 0); } -static void chromeos_gpios(void) +static void snow_setup_gpio(void) { struct exynos5_gpio_part1 *gpio_pt1; struct exynos5_gpio_part2 *gpio_pt2; @@ -137,53 +143,49 @@ static void chromeos_gpios(void) s5p_gpio_set_pull(&gpio_pt2->x1, POWER_GPIO, EXYNOS_GPIO_PULL_NONE); } +static void snow_setup_memory(struct mem_timings *mem, int is_resume) +{ + printk(BIOS_SPEW, "man: 0x%x type: 0x%x, div: 0x%x, mhz: 0x%x\n", + mem->mem_manuf, + mem->mem_type, + mem->mpll_mdiv, + mem->frequency_mhz); + if (ddr3_mem_ctrl_init(mem, DMC_INTERLEAVE_SIZE, !is_resume)) { + die("Failed to initialize memory controller.\n"); + } +} + +static struct mem_timings *snow_setup_clock(void) +{ + struct mem_timings *mem = get_mem_timings(); + struct arm_clk_ratios *arm_ratios = get_arm_clk_ratios(); + if (!mem) { + die("Unable to auto-detect memory timings\n"); + } + system_clock_init(mem, arm_ratios); + return mem; +} + void main(void) { struct mem_timings *mem; - struct arm_clk_ratios *arm_ratios; - int ret; void *entry; - clock_set_rate(PERIPH_ID_SPI1, 50000000); /* set spi clock to 50Mhz */ - /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ - mem = get_mem_timings(); - arm_ratios = get_arm_clk_ratios(); - system_clock_init(mem, arm_ratios); + mem = snow_setup_clock(); console_init(); + snow_setup_power(); - i2c_init(0, CONFIG_SYS_I2C_SPEED, 0x00); - if (power_init()) - power_shutdown(); - printk(BIOS_DEBUG, "%s: setting up pmic...\n", __func__); - if (setup_pmic()) - power_shutdown(); - - if (!mem) { - printk(BIOS_CRIT, "Unable to auto-detect memory timings\n"); - while(1); - } - printk(BIOS_SPEW, "man: 0x%x type: 0x%x, div: 0x%x, mhz: 0x%x\n", - mem->mem_manuf, - mem->mem_type, - mem->mpll_mdiv, - mem->frequency_mhz); - - ret = ddr3_mem_ctrl_init(mem, DMC_INTERLEAVE_SIZE, 1); - if (ret) { - printk(BIOS_ERR, "Memory controller init failed, err: %x\n", - ret); - while(1); - } - - initialize_s5p_mshc(); - - chromeos_gpios(); + snow_setup_memory(mem, 0); - graphics(); + snow_setup_storage(); + snow_setup_gpio(); + snow_setup_graphics(); + /* Set SPI (primary CBFS media) clock to 50MHz. */ + clock_set_rate(PERIPH_ID_SPI1, 50000000); entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram"); printk(BIOS_INFO, "entry is 0x%p, leaving romstage.\n", entry); diff --git a/src/mainboard/google/snow/wakeup.c b/src/mainboard/google/snow/wakeup.c index 33ea9d8..8bb1724 100644 --- a/src/mainboard/google/snow/wakeup.c +++ b/src/mainboard/google/snow/wakeup.c @@ -26,16 +26,16 @@ #include "mainboard.h" -static int wakeup_need_reset(void) +static int snow_wakeup_need_reset(void) { /* The "wake up" event is not reliable (known as "bad wakeup") and needs * reset if GPIO value is high. */ return gpio_get_value(GPIO_Y10); } -void board_wakeup(void) +void snow_wakeup(void) { - if (wakeup_need_reset()) + if (snow_wakeup_need_reset()) power_reset(); power_init(); /* Ensure ps_hold_setup() for early wakeup. */ @@ -44,7 +44,7 @@ void board_wakeup(void) die("Failed to wake up.\n"); } -int board_get_wakeup_state() +int snow_get_wakeup_state() { uint32_t status = power_read_reset_status(); @@ -53,10 +53,10 @@ int board_get_wakeup_state() */ if (status == S5P_CHECK_DIDLE || status == S5P_CHECK_LPA) - return BOARD_WAKEUP_DIRECT; + return SNOW_WAKEUP_DIRECT; if (status == S5P_CHECK_SLEEP) - return BOARD_WAKEUP_NEED_CLOCK_RESET; + return SNOW_WAKEUP_NEED_CLOCK_RESET; - return BOARD_IS_NOT_WAKEUP; + return SNOW_IS_NOT_WAKEUP; }
1 0
0 0
Patch set updated for coreboot: 835aebf Lenovo ThinkPad X60: Init CBMEM early for CBMEM console support.
by Paul Menzel April 26, 2013

April 26, 2013
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3142 -gerrit commit 835aebf9dbdf770d0b3d3430ca8e577cee603d91 Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> Date: Fri Apr 26 12:21:41 2013 +0200 Lenovo ThinkPad X60: Init CBMEM early for CBMEM console support. Enable `EARLY_CBMEM_INIT` for CBMEM console support by looking how other boards do this. This commit is tested by enabling the CBMEM console (`CONSOLE_CBMEM` in Kconfig) and then in GRUB 2 (as a payload) with the cbmemc command from the cbmemc module and in userspace with ./cbmem -c. Both worked. Change-Id: I34618a55ded7292a411bc232eb76267eec17d91e Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> --- src/mainboard/lenovo/x60/Kconfig | 1 + src/mainboard/lenovo/x60/romstage.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig index 611f932..1431a2f 100644 --- a/src/mainboard/lenovo/x60/Kconfig +++ b/src/mainboard/lenovo/x60/Kconfig @@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select HAVE_ACPI_RESUME select USE_OPTION_TABLE select MAINBOARD_HAS_NATIVE_VGA_INIT + select EARLY_CBMEM_INIT config MAINBOARD_DIR string diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c index 8d5f922..d3c1d8a 100644 --- a/src/mainboard/lenovo/x60/romstage.c +++ b/src/mainboard/lenovo/x60/romstage.c @@ -29,6 +29,7 @@ #include <device/pnp_def.h> #include <cpu/x86/lapic.h> #include <lib.h> +#include <cbmem.h> #include <pc80/mc146818rtc.h> #include <console/console.h> #include <cpu/x86/bist.h> @@ -216,6 +217,7 @@ void main(unsigned long bist) { u32 reg32; int boot_mode = 0; + int cbmem_was_initted; const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 }; if (bist == 0) @@ -314,14 +316,13 @@ void main(unsigned long bist) MCHBAR16(SSKPD) = 0xCAFE; -#if CONFIG_HAVE_ACPI_RESUME - /* Start address of high memory tables */ - unsigned long high_ram_base = get_top_of_ram() - HIGH_MEMORY_SIZE; + cbmem_was_initted = !cbmem_initialize(); +#if CONFIG_HAVE_ACPI_RESUME /* If there is no high memory area, we didn't boot before, so * this is not a resume. In that case we just create the cbmem toc. */ - if ((boot_mode == 2) && cbmem_reinit((u64)high_ram_base)) { + if ((boot_mode == 2) && cbmem_was_initted) { void *resume_backup_memory = cbmem_find(CBMEM_ID_RESUME); /* copy 1MB - 64K to high tables ram_base to prevent memory corruption @@ -336,4 +337,9 @@ void main(unsigned long bist) pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC); } #endif + +#if CONFIG_CONSOLE_CBMEM + /* Keep this the last thing this function does. */ + cbmemc_reinit(); +#endif }
1 0
0 0
New patch to review for coreboot: 5f07c21 Kconfig: Capitalize CBMEM in description of `EARLY_CBMEM_INIT`
by Paul Menzel April 26, 2013

April 26, 2013
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3143 -gerrit commit 5f07c215f9afaa0deaa7b5cacf95c02191768853 Author: Paul Menzel <paulepanter(a)users.sourceforge.net> Date: Fri Apr 26 17:15:07 2013 +0200 Kconfig: Capitalize CBMEM in description of `EARLY_CBMEM_INIT` Capitalizing CBMEM seems to be the official spelling as can be seen in the descriptions around the `EARLY_CBMEM_INIT` Kconfig option. Change-Id: I046a678c3b04ef7e681de46aa137cedc405d546f Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net> --- src/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kconfig b/src/Kconfig index c3cc6bf..8ff59d0 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -174,7 +174,7 @@ config EARLY_CBMEM_INIT bool default n help - Make coreboot initialize the cbmem structures while running in ROM + Make coreboot initialize the CBMEM structures while running in ROM stage. This is useful when the ROM stage wants to communicate some, for instance, execution timestamps. It needs support in romstage.c and should be enabled by the board's Kconfig.
1 0
0 0
Patch set updated for coreboot: 5676ba8 Lenovo ThinkPad X60: Init CBMEM early and add CBMEM console support.
by Paul Menzel April 26, 2013

April 26, 2013
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3142 -gerrit commit 5676ba8563456996553f7e088f75b476424af4cb Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> Date: Fri Apr 26 12:21:41 2013 +0200 Lenovo ThinkPad X60: Init CBMEM early and add CBMEM console support. Enable EARLY_CBMEM_INIT and add CBMEM console support. This commit is tested in GRUB 2 (as a payload) with the cbmemc command from the cbmemc module and in userspace with ./cbmem -c. Both worked. Change-Id: I34618a55ded7292a411bc232eb76267eec17d91e Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> --- src/mainboard/lenovo/x60/Kconfig | 1 + src/mainboard/lenovo/x60/romstage.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig index 611f932..1431a2f 100644 --- a/src/mainboard/lenovo/x60/Kconfig +++ b/src/mainboard/lenovo/x60/Kconfig @@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select HAVE_ACPI_RESUME select USE_OPTION_TABLE select MAINBOARD_HAS_NATIVE_VGA_INIT + select EARLY_CBMEM_INIT config MAINBOARD_DIR string diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c index 8d5f922..d3c1d8a 100644 --- a/src/mainboard/lenovo/x60/romstage.c +++ b/src/mainboard/lenovo/x60/romstage.c @@ -29,6 +29,7 @@ #include <device/pnp_def.h> #include <cpu/x86/lapic.h> #include <lib.h> +#include <cbmem.h> #include <pc80/mc146818rtc.h> #include <console/console.h> #include <cpu/x86/bist.h> @@ -216,6 +217,7 @@ void main(unsigned long bist) { u32 reg32; int boot_mode = 0; + int cbmem_was_initted; const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 }; if (bist == 0) @@ -314,14 +316,13 @@ void main(unsigned long bist) MCHBAR16(SSKPD) = 0xCAFE; -#if CONFIG_HAVE_ACPI_RESUME - /* Start address of high memory tables */ - unsigned long high_ram_base = get_top_of_ram() - HIGH_MEMORY_SIZE; + cbmem_was_initted = !cbmem_initialize(); +#if CONFIG_HAVE_ACPI_RESUME /* If there is no high memory area, we didn't boot before, so * this is not a resume. In that case we just create the cbmem toc. */ - if ((boot_mode == 2) && cbmem_reinit((u64)high_ram_base)) { + if ((boot_mode == 2) && cbmem_was_initted) { void *resume_backup_memory = cbmem_find(CBMEM_ID_RESUME); /* copy 1MB - 64K to high tables ram_base to prevent memory corruption @@ -336,4 +337,9 @@ void main(unsigned long bist) pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC); } #endif + +#if CONFIG_CONSOLE_CBMEM + /* Keep this the last thing this function does. */ + cbmemc_reinit(); +#endif }
1 0
0 0
Patch set updated for coreboot: cda6246 Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2
by Ronald G. Minnich April 26, 2013

April 26, 2013
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3122 -gerrit commit cda62461ca4fbe709befda9bd28b6c1be7cc4164 Author: Paul Menzel <paulepanter(a)users.sourceforge.net> Date: Tue Apr 23 13:00:34 2013 +0200 Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2 Commit »Support for the Intel ICH7 southbridge.« (debb11fc) [1] used `1 << 25` to set the I/O APIC ID of 2. Instead using `2 << 24`, which is the same value, makes it clear, that the I/O APIC ID is 2. Commit »Intel Panther Point PCH: Use 2 << 24 to clarify that APIC ID is 2« (8c937c7e) [2] is used as a template. [1] http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=debb11fc1fe5f55… [2] http://review.coreboot.org/3100 Change-Id: Ib688500944cd78a1cc1c8082bb138fa9468bdbfb Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net> --- src/southbridge/intel/i82801gx/lpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c index 3a94e84..777a6d7 100644 --- a/src/southbridge/intel/i82801gx/lpc.c +++ b/src/southbridge/intel/i82801gx/lpc.c @@ -52,12 +52,12 @@ static void i82801gx_enable_apic(struct device *dev) pci_write_config8(dev, ACPI_CNTL, ACPI_EN); *ioapic_index = 0; - *ioapic_data = (1 << 25); + *ioapic_data = (2 << 24); *ioapic_index = 0; reg32 = *ioapic_data; printk(BIOS_DEBUG, "Southbridge APIC ID = %x\n", (reg32 >> 24) & 0x0f); - if (reg32 != (1 << 25)) + if (reg32 != (2 << 24)) die("APIC Error\n"); printk(BIOS_SPEW, "Dumping IOAPIC registers\n");
1 0
0 0
New patch to review for coreboot: 11307f2 Lenovo ThinkPad X60: Add cbmem and cbmem console support.
by Denis Carikli April 26, 2013

April 26, 2013
Denis Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3142 -gerrit commit 11307f22333c34e0a4d91896a7336e05574d5e21 Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> Date: Fri Apr 26 12:21:41 2013 +0200 Lenovo ThinkPad X60: Add cbmem and cbmem console support. This commit was tested in grub2(as a payload) with the cbmemc command, And in userspace with ./cbmem -c Both worked. Change-Id: I34618a55ded7292a411bc232eb76267eec17d91e Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org> --- src/mainboard/lenovo/x60/Kconfig | 1 + src/mainboard/lenovo/x60/romstage.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig index 611f932..1431a2f 100644 --- a/src/mainboard/lenovo/x60/Kconfig +++ b/src/mainboard/lenovo/x60/Kconfig @@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select HAVE_ACPI_RESUME select USE_OPTION_TABLE select MAINBOARD_HAS_NATIVE_VGA_INIT + select EARLY_CBMEM_INIT config MAINBOARD_DIR string diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c index 8d5f922..d3c1d8a 100644 --- a/src/mainboard/lenovo/x60/romstage.c +++ b/src/mainboard/lenovo/x60/romstage.c @@ -29,6 +29,7 @@ #include <device/pnp_def.h> #include <cpu/x86/lapic.h> #include <lib.h> +#include <cbmem.h> #include <pc80/mc146818rtc.h> #include <console/console.h> #include <cpu/x86/bist.h> @@ -216,6 +217,7 @@ void main(unsigned long bist) { u32 reg32; int boot_mode = 0; + int cbmem_was_initted; const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 }; if (bist == 0) @@ -314,14 +316,13 @@ void main(unsigned long bist) MCHBAR16(SSKPD) = 0xCAFE; -#if CONFIG_HAVE_ACPI_RESUME - /* Start address of high memory tables */ - unsigned long high_ram_base = get_top_of_ram() - HIGH_MEMORY_SIZE; + cbmem_was_initted = !cbmem_initialize(); +#if CONFIG_HAVE_ACPI_RESUME /* If there is no high memory area, we didn't boot before, so * this is not a resume. In that case we just create the cbmem toc. */ - if ((boot_mode == 2) && cbmem_reinit((u64)high_ram_base)) { + if ((boot_mode == 2) && cbmem_was_initted) { void *resume_backup_memory = cbmem_find(CBMEM_ID_RESUME); /* copy 1MB - 64K to high tables ram_base to prevent memory corruption @@ -336,4 +337,9 @@ void main(unsigned long bist) pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC); } #endif + +#if CONFIG_CONSOLE_CBMEM + /* Keep this the last thing this function does. */ + cbmemc_reinit(); +#endif }
1 0
0 0
Patch set updated for coreboot: 7ebf2ab google/snow: Revise romstage initialization code.
by Hung-Te Lin April 26, 2013

April 26, 2013
Hung-Te Lin (hungte(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3130 -gerrit commit 7ebf2ab0977db335817f0a344e43985ce5499a6b Author: Hung-Te Lin <hungte(a)chromium.org> Date: Thu Apr 25 19:30:19 2013 +0800 google/snow: Revise romstage initialization code. Move board setup procedure to snow_setup_* functions, ans Snow board-specific (wakeup) code to snow_* for better function names and comments. Verified by successfully building and booting on Google/Snow. Change-Id: I2942d75064135093eeb1c1da188a005fd255111d Signed-off-by: Hung-Te Lin <hungte(a)chromium.org> --- src/mainboard/google/snow/mainboard.h | 10 ++-- src/mainboard/google/snow/romstage.c | 92 ++++++++++++++++++----------------- src/mainboard/google/snow/wakeup.c | 14 +++--- 3 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/mainboard/google/snow/mainboard.h b/src/mainboard/google/snow/mainboard.h index 63a2c18..5060b72 100644 --- a/src/mainboard/google/snow/mainboard.h +++ b/src/mainboard/google/snow/mainboard.h @@ -36,14 +36,14 @@ enum snow_board_config { int board_get_config(void); enum { - BOARD_IS_NOT_WAKEUP, // A normal boot (not suspend/resume). - BOARD_WAKEUP_DIRECT, // A wake up event that can be resumed any time. - BOARD_WAKEUP_NEED_CLOCK_RESET, // A wake up event that must be resumed + SNOW_IS_NOT_WAKEUP, // A normal boot (not suspend/resume). + SNOW_WAKEUP_DIRECT, // A wake up event that can be resumed any time. + SNOW_WAKEUP_NEED_CLOCK_RESET, // A wake up event that must be resumed // only after clock and memory // controllers are re-initialized. }; -int board_get_wakeup_state(void); -void board_wakeup(void); +int snow_get_wakeup_state(void); +void snow_wakeup(void); #endif /* MAINBOARD_H */ diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index 6e312fa..fd5cfce 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -46,10 +46,16 @@ #define PMIC_BUS 0 #define MMC0_GPIO_PIN (58) -static int setup_pmic(void) +static void snow_setup_power(void) { int error = 0; + power_init(); + + /* Initialize I2C bus to configure PMIC. */ + i2c_init(0, CONFIG_SYS_I2C_SPEED, 0x00); + + printk(BIOS_DEBUG, "%s: Setting up PMIC...\n", __func__); /* * We're using CR1616 coin cell battery that is non-rechargeable * battery. But, BBCHOSTEN bit of the BBAT Charger Register in @@ -81,19 +87,19 @@ static int setup_pmic(void) error |= max77686_enable_32khz_cp(PMIC_BUS); - if (error) - printk(BIOS_CRIT, "%s: Error during PMIC setup\n", __func__); - - return error; + if (error) { + printk(BIOS_CRIT, "%s: PMIC error: %#x\n", __func__, error); + die("Failed to intialize PMIC.\n"); + } } -static void initialize_s5p_mshc(void) +static void snow_setup_storage(void) { /* MMC0: Fixed, 8 bit mode, connected with GPIO. */ if (clock_set_mshci(PERIPH_ID_SDMMC0)) - printk(BIOS_CRIT, "Failed to set clock for SDMMC0.\n"); + printk(BIOS_CRIT, "%s: Failed to set MMC0 clock.\n", __func__); if (gpio_direction_output(MMC0_GPIO_PIN, 1)) { - printk(BIOS_CRIT, "Unable to power on SDMMC0.\n"); + printk(BIOS_CRIT, "%s: Unable to power on MMC0.\n", __func__); } gpio_set_pull(MMC0_GPIO_PIN, EXYNOS_GPIO_PULL_NONE); gpio_set_drv(MMC0_GPIO_PIN, EXYNOS_GPIO_DRV_4X); @@ -104,12 +110,12 @@ static void initialize_s5p_mshc(void) exynos_pinmux_config(PERIPH_ID_SDMMC2, 0); } -static void graphics(void) +static void snow_setup_graphics(void) { exynos_pinmux_config(PERIPH_ID_DPHPD, 0); } -static void chromeos_gpios(void) +static void snow_setup_gpio(void) { struct exynos5_gpio_part1 *gpio_pt1; struct exynos5_gpio_part2 *gpio_pt2; @@ -137,53 +143,49 @@ static void chromeos_gpios(void) s5p_gpio_set_pull(&gpio_pt2->x1, POWER_GPIO, EXYNOS_GPIO_PULL_NONE); } +static void snow_setup_memory(struct mem_timings *mem, int is_resume) +{ + printk(BIOS_SPEW, "man: 0x%x type: 0x%x, div: 0x%x, mhz: 0x%x\n", + mem->mem_manuf, + mem->mem_type, + mem->mpll_mdiv, + mem->frequency_mhz); + if (ddr3_mem_ctrl_init(mem, DMC_INTERLEAVE_SIZE, !is_resume)) { + die("Failed to initialize memory controller.\n"); + } +} + +static struct mem_timings *snow_setup_clock(void) +{ + struct mem_timings *mem = get_mem_timings(); + struct arm_clk_ratios *arm_ratios = get_arm_clk_ratios(); + if (!mem) { + die("Unable to auto-detect memory timings\n"); + } + system_clock_init(mem, arm_ratios); + return mem; +} + void main(void) { struct mem_timings *mem; - struct arm_clk_ratios *arm_ratios; - int ret; void *entry; - clock_set_rate(PERIPH_ID_SPI1, 50000000); /* set spi clock to 50Mhz */ - /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ - mem = get_mem_timings(); - arm_ratios = get_arm_clk_ratios(); - system_clock_init(mem, arm_ratios); + mem = snow_setup_clock(); console_init(); + snow_setup_power(); - i2c_init(0, CONFIG_SYS_I2C_SPEED, 0x00); - if (power_init()) - power_shutdown(); - printk(BIOS_DEBUG, "%s: setting up pmic...\n", __func__); - if (setup_pmic()) - power_shutdown(); - - if (!mem) { - printk(BIOS_CRIT, "Unable to auto-detect memory timings\n"); - while(1); - } - printk(BIOS_SPEW, "man: 0x%x type: 0x%x, div: 0x%x, mhz: 0x%x\n", - mem->mem_manuf, - mem->mem_type, - mem->mpll_mdiv, - mem->frequency_mhz); - - ret = ddr3_mem_ctrl_init(mem, DMC_INTERLEAVE_SIZE, 1); - if (ret) { - printk(BIOS_ERR, "Memory controller init failed, err: %x\n", - ret); - while(1); - } - - initialize_s5p_mshc(); - - chromeos_gpios(); + snow_setup_memory(mem, 0); - graphics(); + snow_setup_storage(); + snow_setup_gpio(); + snow_setup_graphics(); + /* Set SPI (primary CBFS media) clock to 50MHz. */ + clock_set_rate(PERIPH_ID_SPI1, 50000000); entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram"); printk(BIOS_INFO, "entry is 0x%p, leaving romstage.\n", entry); diff --git a/src/mainboard/google/snow/wakeup.c b/src/mainboard/google/snow/wakeup.c index 33ea9d8..8bb1724 100644 --- a/src/mainboard/google/snow/wakeup.c +++ b/src/mainboard/google/snow/wakeup.c @@ -26,16 +26,16 @@ #include "mainboard.h" -static int wakeup_need_reset(void) +static int snow_wakeup_need_reset(void) { /* The "wake up" event is not reliable (known as "bad wakeup") and needs * reset if GPIO value is high. */ return gpio_get_value(GPIO_Y10); } -void board_wakeup(void) +void snow_wakeup(void) { - if (wakeup_need_reset()) + if (snow_wakeup_need_reset()) power_reset(); power_init(); /* Ensure ps_hold_setup() for early wakeup. */ @@ -44,7 +44,7 @@ void board_wakeup(void) die("Failed to wake up.\n"); } -int board_get_wakeup_state() +int snow_get_wakeup_state() { uint32_t status = power_read_reset_status(); @@ -53,10 +53,10 @@ int board_get_wakeup_state() */ if (status == S5P_CHECK_DIDLE || status == S5P_CHECK_LPA) - return BOARD_WAKEUP_DIRECT; + return SNOW_WAKEUP_DIRECT; if (status == S5P_CHECK_SLEEP) - return BOARD_WAKEUP_NEED_CLOCK_RESET; + return SNOW_WAKEUP_NEED_CLOCK_RESET; - return BOARD_IS_NOT_WAKEUP; + return SNOW_IS_NOT_WAKEUP; }
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • ...
  • 51
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.