Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 3 | |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 4 | #include <stdint.h> |
Michał Żygowski | 287ce5f | 2019-12-01 17:41:23 +0100 | [diff] [blame] | 5 | #include <amdblocks/acpimmio.h> |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 6 | #include "SBPLATFORM.h" |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 7 | #include "sb_cimx.h" |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 8 | #include "cfg.h" /*sb800_cimx_config*/ |
| 9 | |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 10 | /** |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 11 | * @brief South Bridge CIMx romstage entry, |
| 12 | * wrapper of sbPowerOnInit entry point. |
| 13 | */ |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 14 | void sb_Poweron_Init(void) |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 15 | { |
| 16 | AMDSBCFG sb_early_cfg; |
| 17 | |
| 18 | sb800_cimx_config(&sb_early_cfg); |
| 19 | //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT; |
| 20 | //AmdSbDispatcher(&sb_early_cfg); |
| 21 | //TODO |
| 22 | //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher, |
Martin Roth | d630c13 | 2014-12-17 09:14:17 -0700 | [diff] [blame] | 23 | // VerifyImage() will fail, LocateImage() takes minutes to find the image. |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 24 | sbPowerOnInit(&sb_early_cfg); |
| 25 | } |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * CIMX not set the clock to 48Mhz until sbBeforePciInit, |
| 29 | * coreboot may need to set this even more earlier |
| 30 | */ |
| 31 | void sb800_clk_output_48Mhz(void) |
| 32 | { |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 33 | |
Michał Żygowski | 287ce5f | 2019-12-01 17:41:23 +0100 | [diff] [blame] | 34 | misc_write32(0x40, misc_read32(0x40) & (~5)); |
| 35 | misc_write32(0x40, misc_read32(0x40) | 2); |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 36 | } |