nb/intel/sandybridge: Drop casts from DEFAULT_{MCHBAR,DMIBAR}
This allows us to drop some casts to uintptr_t around the tree. The MCHBAR32 macro still needs a cast to preserve reproducibility. Only the native raminit path needs the cast, the MRC path does not. Tested with BUILD_TIMELESS=1, these boards remain identical: - Lenovo ThinkPad X230 - Dell OptiPlex 9010 - Roda RW11 (with MRC raminit) Change-Id: I8ca1c35e2c1f1b4f0d83bd7bb080b8667dbe3cb3 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45349 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
92717ff3e4
commit
c8027454ba
@ -85,8 +85,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
|
||||
struct pei_data pd = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -32,8 +32,8 @@ void bootblock_mainboard_early_init(void)
|
||||
* FIXME: the board gets stuck in reset loop in
|
||||
* mainboard_romstage_entry. Avoid that by clearing SSKPD
|
||||
*/
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR, (uintptr_t)DEFAULT_MCHBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR + 4, (0LL + (uintptr_t)DEFAULT_MCHBAR) >> 32);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR, DEFAULT_MCHBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR + 4, (0LL + DEFAULT_MCHBAR) >> 32);
|
||||
MCHBAR16(SSKPD_HI) = 0;
|
||||
|
||||
sch5545_early_init(0x2e);
|
||||
|
@ -79,8 +79,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -86,8 +86,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -54,8 +54,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -91,8 +91,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -14,8 +14,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -51,8 +51,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -56,8 +56,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -12,8 +12,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -10,8 +10,8 @@ void mainboard_fill_pei_data(struct pei_data *const pei_data)
|
||||
{
|
||||
const struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -40,8 +40,8 @@ void mainboard_fill_pei_data(struct pei_data *const pei_data)
|
||||
{
|
||||
const struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -117,8 +117,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -101,8 +101,8 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
|
||||
{
|
||||
struct pei_data pei_data_template = {
|
||||
.pei_version = PEI_VERSION,
|
||||
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
|
||||
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
|
||||
.mchbar = DEFAULT_MCHBAR,
|
||||
.dmibar = DEFAULT_DMIBAR,
|
||||
.epbar = DEFAULT_EPBAR,
|
||||
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
|
||||
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
|
||||
|
@ -52,10 +52,10 @@ static void sandybridge_setup_bars(void)
|
||||
/* Set up all hardcoded northbridge BARs */
|
||||
pci_write_config32(HOST_BRIDGE, EPBAR, DEFAULT_EPBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, EPBAR + 4, (0LL + DEFAULT_EPBAR) >> 32);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR, (uintptr_t)DEFAULT_MCHBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR + 4, (0LL + (uintptr_t)DEFAULT_MCHBAR) >> 32);
|
||||
pci_write_config32(HOST_BRIDGE, DMIBAR, (uintptr_t)DEFAULT_DMIBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, DMIBAR + 4, (0LL + (uintptr_t)DEFAULT_DMIBAR) >> 32);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR, DEFAULT_MCHBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, MCHBAR + 4, (0LL + DEFAULT_MCHBAR) >> 32);
|
||||
pci_write_config32(HOST_BRIDGE, DMIBAR, DEFAULT_DMIBAR | 1);
|
||||
pci_write_config32(HOST_BRIDGE, DMIBAR + 4, (0LL + DEFAULT_DMIBAR) >> 32);
|
||||
|
||||
printk(BIOS_DEBUG, " done\n");
|
||||
}
|
||||
|
@ -21,13 +21,8 @@
|
||||
#define IVB_STEP_D0 (BASE_REV_IVB + 6)
|
||||
|
||||
/* Northbridge BARs */
|
||||
#ifndef __ACPI__
|
||||
#define DEFAULT_MCHBAR ((u8 *)0xfed10000) /* 16 KB */
|
||||
#define DEFAULT_DMIBAR ((u8 *)0xfed18000) /* 4 KB */
|
||||
#else
|
||||
#define DEFAULT_MCHBAR 0xfed10000 /* 16 KB */
|
||||
#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
|
||||
#endif
|
||||
#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
|
||||
|
||||
#define GFXVT_BASE 0xfed90000ULL
|
||||
@ -65,7 +60,7 @@ enum platform_type {
|
||||
|
||||
#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x))))
|
||||
#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x))))
|
||||
#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + (x))))
|
||||
#define MCHBAR32(x) (*((volatile u32 *)((void *)DEFAULT_MCHBAR + (x))))
|
||||
#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
|
||||
#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
|
||||
#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
|
||||
|
Loading…
x
Reference in New Issue
Block a user