Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 16 | #include <stdint.h> |
Michał Żygowski | 287ce5f | 2019-12-01 17:41:23 +0100 | [diff] [blame^] | 17 | #include <amdblocks/acpimmio.h> |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 18 | #include "SBPLATFORM.h" |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 19 | #include "sb_cimx.h" |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 20 | #include "cfg.h" /*sb800_cimx_config*/ |
| 21 | |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 22 | /** |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 23 | * @brief South Bridge CIMx romstage entry, |
| 24 | * wrapper of sbPowerOnInit entry point. |
| 25 | */ |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 26 | void sb_Poweron_Init(void) |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 27 | { |
| 28 | AMDSBCFG sb_early_cfg; |
| 29 | |
| 30 | sb800_cimx_config(&sb_early_cfg); |
| 31 | //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT; |
| 32 | //AmdSbDispatcher(&sb_early_cfg); |
| 33 | //TODO |
| 34 | //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher, |
Martin Roth | d630c13 | 2014-12-17 09:14:17 -0700 | [diff] [blame] | 35 | // VerifyImage() will fail, LocateImage() takes minutes to find the image. |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 36 | sbPowerOnInit(&sb_early_cfg); |
| 37 | } |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * CIMX not set the clock to 48Mhz until sbBeforePciInit, |
| 41 | * coreboot may need to set this even more earlier |
| 42 | */ |
| 43 | void sb800_clk_output_48Mhz(void) |
| 44 | { |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 45 | |
Michał Żygowski | 287ce5f | 2019-12-01 17:41:23 +0100 | [diff] [blame^] | 46 | misc_write32(0x40, misc_read32(0x40) & (~5)); |
| 47 | misc_write32(0x40, misc_read32(0x40) | 2); |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 48 | } |