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