HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() ......................................................................
nb/intel/pineview: Use new mchbar{8,16,32}_and_or()
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/pineview/Makefile.inc M src/northbridge/intel/pineview/early_init.c M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/pineview/raminit.c 6 files changed, 417 insertions(+), 344 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/1
diff --git a/src/northbridge/intel/common/mchbar_ops.c b/src/northbridge/intel/common/mchbar_ops.c new file mode 100644 index 0000000..c3fccad --- /dev/null +++ b/src/northbridge/intel/common/mchbar_ops.c @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <stdint.h> +#include "mchbar_ops.h" + +void mchbar8_and_or(int offset, u8 mask, u8 or) +{ + u8 reg8 = MCHBAR8(offset); + + reg8 &= mask; + reg8 |= or; + MCHBAR8(offset) = reg8; +} + +void mchbar16_and_or(int offset, u16 mask, u16 or) +{ + u16 reg16 = MCHBAR32(offset); + + reg16 &= mask; + reg16 |= or; + MCHBAR16(offset) = reg16; +} + +void mchbar32_and_or(int offset, u32 mask, u32 or) +{ + u32 reg32 = MCHBAR32(offset); + + reg32 &= mask; + reg32 |= or; + MCHBAR32(offset) = reg32; +} + +void mchbar8_and(int offset, u8 and) +{ + mchbar8_and_or(offset, and, 0); +} + +void mchbar16_and(int offset, u16 and) +{ + mchbar16_and_or(offset, and, 0); +} + +void mchbar32_and(int offset, u32 and) +{ + mchbar32_and_or(offset, and, 0); +} + +void mchbar8_or(int offset, u8 or) +{ + mchbar8_and_or(offset, 0xff, or); +} + +void mchbar16_or(int offset, u16 or) +{ + mchbar16_and_or(offset, 0xffff, or); +} + +void mchbar32_or(int offset, u32 or) +{ + mchbar32_and_or(offset, 0xffffffff, or); +} diff --git a/src/northbridge/intel/common/mchbar_ops.h b/src/northbridge/intel/common/mchbar_ops.h new file mode 100644 index 0000000..cf39c2b --- /dev/null +++ b/src/northbridge/intel/common/mchbar_ops.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef MCHBAR_OPS_H +#define MCHBAR_OPS_H + +#include <stdint.h> +#include <northbridge/intel/pineview/memmap.h> + +#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + x))) +#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + x))) +#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + x))) + +void mchbar8_and_or(int offset, u8 mask, u8 or); +void mchbar16_and_or(int offset, u16 mask, u16 or); +void mchbar32_and_or(int offset, u32 mask, u32 or); +void mchbar8_and(int offset, u8 and); +void mchbar16_and(int offset, u16 and); +void mchbar32_and(int offset, u32 and); +void mchbar8_or(int offset, u8 or); +void mchbar16_or(int offset, u16 or); +void mchbar32_or(int offset, u32 or); + +#endif diff --git a/src/northbridge/intel/pineview/Makefile.inc b/src/northbridge/intel/pineview/Makefile.inc index 08e04f2..4ba902e 100644 --- a/src/northbridge/intel/pineview/Makefile.inc +++ b/src/northbridge/intel/pineview/Makefile.inc @@ -14,6 +14,7 @@ romstage-y += memmap.c romstage-y += raminit.c romstage-y += early_init.c +romstage-y += ../common/mchbar_ops.c
postcar-y += memmap.c
diff --git a/src/northbridge/intel/pineview/early_init.c b/src/northbridge/intel/pineview/early_init.c index 42a68d8..ec7c575 100644 --- a/src/northbridge/intel/pineview/early_init.c +++ b/src/northbridge/intel/pineview/early_init.c @@ -3,6 +3,7 @@ #include <console/console.h> #include <device/pci_ops.h> #include <device/pci_def.h> +#include <northbridge/intel/common/mchbar_ops.h> #include <northbridge/intel/pineview/pineview.h> #include <northbridge/intel/pineview/chip.h> #include <option.h> @@ -67,10 +68,10 @@
if (config->use_crt) { /* Enable VGA */ - MCHBAR32_OR(DACGIOCTRL1, 1 << 15); + mchbar32_or(DACGIOCTRL1, 1 << 15); } else { /* Disable VGA */ - MCHBAR32_AND(DACGIOCTRL1, ~(1 << 15)); + mchbar32_and(DACGIOCTRL1, ~(1 << 15)); }
if (config->use_lvds) { @@ -79,17 +80,17 @@ reg32 &= ~0xf1000000; reg32 |= 0x90000000; MCHBAR32(LVDSICR2) = reg32; - MCHBAR32_OR(IOCKTRR1, 1 << 9); + mchbar32_or(IOCKTRR1, 1 << 9); } else { /* Disable LVDS */ - MCHBAR32_OR(DACGIOCTRL1, 3 << 25); + mchbar32_or(DACGIOCTRL1, 3 << 25); }
MCHBAR32(CICTRL) = 0xc6db8b5f; MCHBAR16(CISDCTRL) = 0x024f;
- MCHBAR32_AND(DACGIOCTRL1, 0xffffff00); - MCHBAR32_OR(DACGIOCTRL1, 1 << 5); + mchbar32_and(DACGIOCTRL1, 0xffffff00); + mchbar32_or(DACGIOCTRL1, 1 << 5);
/* Legacy backlight control */ pci_write_config8(GMCH_IGD, 0xf4, 0x4c); diff --git a/src/northbridge/intel/pineview/pineview.h b/src/northbridge/intel/pineview/pineview.h index 03fa318..121c65b 100644 --- a/src/northbridge/intel/pineview/pineview.h +++ b/src/northbridge/intel/pineview/pineview.h @@ -5,6 +5,7 @@
#include <northbridge/intel/pineview/memmap.h> #include <southbridge/intel/i82801gx/i82801gx.h> +#include <northbridge/intel/common/mchbar_ops.h>
#define BOOT_PATH_NORMAL 0 #define BOOT_PATH_RESET 1 @@ -36,23 +37,8 @@
/* * MCHBAR + *As there are many registers, define them on a separate file */ - -#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x)))) -#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x)))) -#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + x))) /* FIXME: causes changes */ -#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)) -#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or)) -#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or)) -#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or)) -#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or)) -#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or)) -#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or)) - -/* As there are many registers, define them on a separate file */ - #include "mchbar_regs.h"
/* diff --git a/src/northbridge/intel/pineview/raminit.c b/src/northbridge/intel/pineview/raminit.c index 43149be..b190781 100644 --- a/src/northbridge/intel/pineview/raminit.c +++ b/src/northbridge/intel/pineview/raminit.c @@ -8,6 +8,7 @@ #include <console/console.h> #include <delay.h> #include <lib.h> +#include <northbridge/intel/common/mchbar_ops.h> #include "pineview.h" #include "raminit.h" #include <spd.h> @@ -501,7 +502,7 @@ if (s->boot_path == BOOT_PATH_RESET) return;
- MCHBAR32_OR(PMSTS, 1); + mchbar32_or(PMSTS, 1);
reg32 = (MCHBAR32(CLKCFG) & ~0x70) | (1 << 10); if (s->selected_timings.mem_clock == MEM_CLOCK_800MHz) { @@ -566,7 +567,7 @@ MCHBAR32(HMCCPEXT) = 0; MCHBAR32(HMDCPEXT) = clkcross[fsb_freq][ddr_freq][3];
- MCHBAR32_OR(HMCCMC, 1 << 7); + mchbar32_or(HMCCMC, 1 << 7);
if ((fsb_freq == 0) && (ddr_freq == 1)) { MCHBAR8(CLKXSSH2MCBYPPHAS) = 0; @@ -616,8 +617,8 @@ u8 ddr_freq; u16 mpll_ctl;
- MCHBAR16_AND(CSHRMISCCTL1, ~(1 << 8)); - MCHBAR8_AND(CSHRMISCCTL1, ~0x3f); + mchbar16_and(CSHRMISCCTL1, (u16)~(1 << 8)); + mchbar8_and(CSHRMISCCTL1, (u8)~0x3f);
if (s->selected_timings.mem_clock == MEM_CLOCK_667MHz) { ddr_freq = 0; @@ -627,10 +628,10 @@ mpll_ctl = (1 << 8) | (1 << 5); } if (s->boot_path != BOOT_PATH_RESET) - MCHBAR16_AND_OR(MPLLCTL, ~(0x033f), mpll_ctl); + mchbar16_and_or(MPLLCTL, (u16)~(0x033f), mpll_ctl);
MCHBAR32(C0GNT2LNCH1) = 0x58001117; - MCHBAR32_OR(C0STATRDCTRL, 1 << 23); + mchbar32_or(C0STATRDCTRL, 1 << 23);
const u32 cas_to_reg[2][4] = { {0x00000000, 0x00030100, 0x0C240201, 0x00000000}, /* DDR = 667 */ @@ -682,7 +683,7 @@ flag = 1; }
- MCHBAR8_OR(C0PVCFG, 0x03); + mchbar8_or(C0PVCFG, 0x03); MCHBAR16(C0CYCTRKPCHG) = ((wl + 4 + s->selected_timings.tWR) << 6) | ((2 + MAX(s->selected_timings.tRTP, 2)) << 2) | 1;
@@ -699,7 +700,7 @@
/* FIXME: Only applies to DDR2 */ reg16 = (MCHBAR16(C0CYCTRKACT + 2) & 0x0fc0) >> 6; - MCHBAR16_AND_OR(SHCYCTRKCKEL, ~0x1f80, (reg16 << 7)); + mchbar16_and_or(SHCYCTRKCKEL, (u16)~0x1f80, (reg16 << 7));
reg16 = (s->selected_timings.tRCD << 12) | (4 << 8) | (ta2 << 4) | ta4; MCHBAR16(C0CYCTRKWR) = reg16; @@ -714,10 +715,10 @@ MCHBAR8(C0CYCTRKREFR) = (u8) (reg16); MCHBAR8(C0CYCTRKREFR + 1) = (u8) (reg16 >> 8);
- MCHBAR16_AND_OR(C0CKECTRL, ~0x03fe, 100 << 1); - MCHBAR8_AND_OR(C0CYCTRKPCHG2, ~0x3f, s->selected_timings.tRAS); + mchbar16_and_or(C0CKECTRL, (u16)~0x03fe, 100 << 1); + mchbar8_and_or(C0CYCTRKPCHG2, (u8)~0x3f, s->selected_timings.tRAS); MCHBAR16(C0ARBCTRL) = 0x2310; - MCHBAR8_AND_OR(C0ADDCSCTRL, ~0x1f, 1); + mchbar8_and_or(C0ADDCSCTRL, (u8)~0x1f, 1);
if (s->selected_timings.mem_clock == MEM_CLOCK_667MHz) { reg32 = 3000; @@ -730,7 +731,7 @@ reg2 = 5000; } reg16 = (u16)((((s->selected_timings.CAS + 7) * (reg32)) / reg2) << 8); - MCHBAR16_AND_OR(C0STATRDCTRL, ~0x1f00, reg16); + mchbar16_and_or(C0STATRDCTRL, (u16)~0x1f00, reg16);
flag = 0; if (wl > 2) { @@ -739,13 +740,13 @@ reg16 = (u8) (wl - 1 - flag); reg16 |= reg16 << 4; reg16 |= flag << 8; - MCHBAR16_AND_OR(C0WRDATACTRL, ~0x01ff, reg16); + mchbar16_and_or(C0WRDATACTRL, (u16)~0x01ff, reg16);
MCHBAR16(C0RDQCTRL) = 0x1585; - MCHBAR8_AND(C0PWLRCTRL, ~0x1f); + mchbar8_and(C0PWLRCTRL, (u8)~0x1f);
/* rdmodwr_window[5..0] = CL+4+5 265[13..8] (264[21..16]) */ - MCHBAR16_AND_OR(C0PWLRCTRL, ~0x3f00, (s->selected_timings.CAS + 9) << 8); + mchbar16_and_or(C0PWLRCTRL, (u16)~0x3f00, (s->selected_timings.CAS + 9) << 8);
if (s->selected_timings.mem_clock == MEM_CLOCK_667MHz) { reg16 = 0x0514; @@ -754,115 +755,115 @@ reg16 = 0x0618; reg32 = 0x0c30; } - MCHBAR32_AND_OR(C0REFRCTRL2, ~0x0fffff00, (0x3f << 22) | (reg32 << 8)); + mchbar32_and_or(C0REFRCTRL2, (u32)~0x0fffff00, (0x3f << 22) | (reg32 << 8));
/* FIXME: Is this weird access necessary? Reference code does it */ MCHBAR8(C0REFRCTRL + 3) = 0; - MCHBAR16_AND_OR(C0REFCTRL, 0xc000, reg16); + mchbar16_and_or(C0REFCTRL, 0xc000, reg16);
/* NPUT Static Mode */ - MCHBAR8_OR(C0DYNRDCTRL, 1); + mchbar8_or(C0DYNRDCTRL, 1);
- MCHBAR32_AND_OR(C0STATRDCTRL, ~0x7f000000, 0xb << 25); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x7f000000, 0xb << 25); i = s->selected_timings.mem_clock; j = s->selected_timings.fsb_clock; if (i > j) { - MCHBAR32_OR(C0STATRDCTRL, 1 << 24); + mchbar32_or(C0STATRDCTRL, 1 << 24); }
- MCHBAR8_AND(C0RDFIFOCTRL, ~0x3); - MCHBAR16_AND_OR(C0WRDATACTRL, ~0x7c00, (wl + 10) << 10); - MCHBAR32_AND_OR(C0CKECTRL, ~0x070e0000, (3 << 24) | (3 << 17)); + mchbar8_and(C0RDFIFOCTRL, (u8)~0x3); + mchbar16_and_or(C0WRDATACTRL, (u16)~0x7c00, (wl + 10) << 10); + mchbar32_and_or(C0CKECTRL, (u32)~0x070e0000, (3 << 24) | (3 << 17)); reg16 = 0x15 << 6; reg16 |= 0x1f; reg16 |= (0x6 << 12); - MCHBAR16_AND_OR(C0REFRCTRL + 4, ~0x7fff, reg16); + mchbar16_and_or(C0REFRCTRL + 4, (u16)~0x7fff, reg16);
reg32 = (0x6 << 27) | (1 << 25); /* FIXME: For DDR3, set BIT26 as well */ - MCHBAR32_AND_OR(C0REFRCTRL2, ~0x30000000, reg32 << 8); - MCHBAR8_AND_OR(C0REFRCTRL + 3, ~0xfa, reg32 >> 24); - MCHBAR8_AND(C0JEDEC, ~(1 << 7)); - MCHBAR8_AND(C0DYNRDCTRL, ~0x6); + mchbar32_and_or(C0REFRCTRL2, (u32)~0x30000000, reg32 << 8); + mchbar8_and_or(C0REFRCTRL + 3, (u8)~0xfa, reg32 >> 24); + mchbar8_and(C0JEDEC, (u8)~(1 << 7)); + mchbar8_and(C0DYNRDCTRL, (u8)~0x6);
/* Note: This is a 64-bit register, [34..30] = 0b00110 is split across two writes */ reg32 = ((6 & 3) << 30) | (4 << 25) | (1 << 20) | (8 << 15) | (6 << 10) | (4 << 5) | 1; MCHBAR32(C0WRWMFLSH) = reg32; - MCHBAR16_AND_OR(C0WRWMFLSH + 4, ~0x1ff, (8 << 3) | (6 >> 2)); - MCHBAR16_OR(SHPENDREG, 0x1c00 | (0x1f << 5)); + mchbar16_and_or(C0WRWMFLSH + 4, (u16)~0x1ff, (8 << 3) | (6 >> 2)); + mchbar16_or(SHPENDREG, 0x1c00 | (0x1f << 5));
/* FIXME: Why not do a single word write? */ - MCHBAR8_AND_OR(SHPAGECTRL, ~0xff, 0x40); - MCHBAR8_AND_OR(SHPAGECTRL + 1, ~0x07, 0x05); - MCHBAR8_OR(SHCMPLWRCMD, 0x1f); + mchbar8_and_or(SHPAGECTRL, (u8)~0xff, 0x40); + mchbar8_and_or(SHPAGECTRL + 1, (u8)~0x07, 0x05); + mchbar8_or(SHCMPLWRCMD, 0x1f);
reg8 = (3 << 6); reg8 |= (s->dt0mode << 4); reg8 |= 0x0c; - MCHBAR8_AND_OR(SHBONUSREG, ~0xdf, reg8); - MCHBAR8_AND(CSHRWRIOMLNS, ~0x02); - MCHBAR8_AND_OR(C0MISCTM, ~0x07, 0x02); - MCHBAR16_AND_OR(C0BYPCTRL, ~0x3fc, 4 << 2); + mchbar8_and_or(SHBONUSREG, (u8)~0xdf, reg8); + mchbar8_and(CSHRWRIOMLNS, (u8)~0x02); + mchbar8_and_or(C0MISCTM, (u8)~0x07, 0x02); + mchbar16_and_or(C0BYPCTRL, (u16)~0x3fc, 4 << 2);
/* [31..29] = 0b010 for kN = 2 (2N) */ reg32 = (2 << 29) | (1 << 28) | (1 << 23); - MCHBAR32_AND_OR(WRWMCONFIG, ~0xffb00000, reg32); + mchbar32_and_or(WRWMCONFIG, (u32)~0xffb00000, reg32);
reg8 = (u8) ((MCHBAR16(C0CYCTRKACT) & 0xe000) >> 13); reg8 |= (u8) ((MCHBAR16(C0CYCTRKACT + 2) & 1) << 3); - MCHBAR8_AND_OR(BYPACTSF, ~0xf0, reg8 << 4); + mchbar8_and_or(BYPACTSF, (u8)~0xf0, reg8 << 4);
reg8 = (u8) ((MCHBAR32(C0CYCTRKRD) & 0x000f0000) >> 17); - MCHBAR8_AND_OR(BYPACTSF, ~0x0f, reg8); + mchbar8_and_or(BYPACTSF, (u8)~0x0f, reg8);
/* FIXME: Why not clear everything at once? */ - MCHBAR8_AND(BYPKNRULE, ~0xfc); - MCHBAR8_AND(BYPKNRULE, ~0x03); - MCHBAR8_AND(SHBONUSREG, ~0x03); - MCHBAR8_OR(C0BYPCTRL, 1); - MCHBAR16_OR(CSHRMISCCTL1, 1 << 9); + mchbar8_and(BYPKNRULE, (u8)~0xfc); + mchbar8_and(BYPKNRULE, (u8)~0x03); + mchbar8_and(SHBONUSREG, (u8)~0x03); + mchbar8_or(C0BYPCTRL, 1); + mchbar16_or(CSHRMISCCTL1, 1 << 9);
for (i = 0; i < 8; i++) { /* FIXME: Hardcoded for DDR2 SO-DIMMs */ - MCHBAR32_AND_OR(C0DLLRCVCTLy(i), ~0x3f3f3f3f, 0x0c0c0c0c); + mchbar32_and_or(C0DLLRCVCTLy(i), (u32)~0x3f3f3f3f, 0x0c0c0c0c); } /* RDCS to RCVEN delay: Program coarse common to all bytelanes to default tCL + 1 */ - MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, (s->selected_timings.CAS + 1) << 16); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, (s->selected_timings.CAS + 1) << 16);
/* Program RCVEN delay with DLL-safe settings */ for (i = 0; i < 8; i++) { - MCHBAR8_AND(C0RXRCVyDLL(i), ~0x3f); - MCHBAR16_AND(C0RCVMISCCTL2, (u16) ~(3 << (i * 2))); - MCHBAR16_AND(C0RCVMISCCTL1, (u16) ~(3 << (i * 2))); - MCHBAR16_AND(C0COARSEDLY0, (u16) ~(3 << (i * 2))); + mchbar8_and(C0RXRCVyDLL(i), (u8)~0x3f); + mchbar16_and(C0RCVMISCCTL2, (u16)~(3 << (i * 2))); + mchbar16_and(C0RCVMISCCTL1, (u16)~(3 << (i * 2))); + mchbar16_and(C0COARSEDLY0, (u16)~(3 << (i * 2))); } - MCHBAR8_AND(C0DLLPIEN, ~1); /* Power up receiver */ - MCHBAR8_OR(C0DLLPIEN, 2); /* Enable RCVEN DLL */ - MCHBAR8_OR(C0DLLPIEN, 4); /* Enable receiver DQS DLL */ - MCHBAR32_OR(C0COREBONUS, 0x000c0400); - MCHBAR32_OR(C0CMDTX1, 1 << 31); + mchbar8_and(C0DLLPIEN, (u8)~1); /* Power up receiver */ + mchbar8_or(C0DLLPIEN, 2); /* Enable RCVEN DLL */ + mchbar8_or(C0DLLPIEN, 4); /* Enable receiver DQS DLL */ + mchbar32_or(C0COREBONUS, 0x000c0400); + mchbar32_or(C0CMDTX1, 1 << 31); }
/* Program clkset0's register for Kcoarse, Tap, PI, DBEn and DBSel */ static void sdram_p_clkset0(const struct pllparam *pll, u8 f, u8 i) { - MCHBAR16_AND_OR(C0CKTX, ~0xc440, + mchbar16_and_or(C0CKTX, (u16)~0xc440, (pll->clkdelay[f][i] << 14) | (pll->dben[f][i] << 10) | (pll->dbsel[f][i] << 6));
- MCHBAR8_AND_OR(C0TXCK0DLL, ~0x3f, pll->pi[f][i]); + mchbar8_and_or(C0TXCK0DLL, (u8)~0x3f, pll->pi[f][i]); }
/* Program clkset1's register for Kcoarse, Tap, PI, DBEn and DBSel */ static void sdram_p_clkset1(const struct pllparam *pll, u8 f, u8 i) { /* FIXME: This is actually a dword write! */ - MCHBAR16_AND_OR(C0CKTX, ~0x00030880, + mchbar16_and_or(C0CKTX, (u16)~0x00030880, (pll->clkdelay[f][i] << 16) | (pll->dben[f][i] << 11) | (pll->dbsel[f][i] << 7));
- MCHBAR8_AND_OR(C0TXCK1DLL, ~0x3f, pll->pi[f][i]); + mchbar8_and_or(C0TXCK1DLL, (u8)~0x3f, pll->pi[f][i]); }
/* Program CMD0 and CMD1 registers for Kcoarse, Tap, PI, DBEn and DBSel */ @@ -872,14 +873,14 @@ /* Clock Group Index 3 */ reg8 = pll->dbsel[f][i] << 5; reg8 |= pll->dben[f][i] << 6; - MCHBAR8_AND_OR(C0CMDTX1, ~0x60, reg8); + mchbar8_and_or(C0CMDTX1, (u8)~0x60, reg8);
reg8 = pll->clkdelay[f][i] << 4; - MCHBAR8_AND_OR(C0CMDTX2, ~0x30, reg8); + mchbar8_and_or(C0CMDTX2, (u8)~0x30, reg8);
reg8 = pll->pi[f][i]; - MCHBAR8_AND_OR(C0TXCMD0DLL, ~0x3f, reg8); - MCHBAR8_AND_OR(C0TXCMD1DLL, ~0x3f, reg8); + mchbar8_and_or(C0TXCMD0DLL, (u8)~0x3f, reg8); + mchbar8_and_or(C0TXCMD1DLL, (u8)~0x3f, reg8); }
/* Program CTRL registers for Kcoarse, Tap, PI, DBEn and DBSel */ @@ -895,11 +896,11 @@ reg32 |= ((u32) pll->dben[f][i]) << 23; reg32 |= ((u32) pll->clkdelay[f][i]) << 24; reg32 |= ((u32) pll->clkdelay[f][i]) << 27; - MCHBAR32_AND_OR(C0CTLTX2, ~0x01bf0000, reg32); + mchbar32_and_or(C0CTLTX2, (u32)~0x01bf0000, reg32);
reg8 = pll->pi[f][i]; - MCHBAR8_AND_OR(C0TXCTL0DLL, ~0x3f, reg8); - MCHBAR8_AND_OR(C0TXCTL1DLL, ~0x3f, reg8); + mchbar8_and_or(C0TXCTL0DLL, (u8)~0x3f, reg8); + mchbar8_and_or(C0TXCTL1DLL, (u8)~0x3f, reg8);
/* CTRL2 and CTRL3 */ reg32 = ((u32) pll->dbsel[f][i]) << 12; @@ -908,11 +909,11 @@ reg32 |= ((u32) pll->dben[f][i]) << 9; reg32 |= ((u32) pll->clkdelay[f][i]) << 14; reg32 |= ((u32) pll->clkdelay[f][i]) << 10; - MCHBAR32_AND_OR(C0CMDTX2, ~0xff00, reg32); + mchbar32_and_or(C0CMDTX2, (u32)~0xff00, reg32);
reg8 = pll->pi[f][i]; - MCHBAR8_AND_OR(C0TXCTL2DLL, ~0x3f, reg8); - MCHBAR8_AND_OR(C0TXCTL3DLL, ~0x3f, reg8); + mchbar8_and_or(C0TXCTL2DLL, (u8)~0x3f, reg8); + mchbar8_and_or(C0TXCTL3DLL, (u8)~0x3f, reg8); }
static void sdram_p_dqs(struct pllparam *pll, u8 f, u8 clk) @@ -934,11 +935,11 @@ & ~((1 << (dqs + 9)) | (1 << dqs))) | reg32;
reg32 = ((u32) pll->clkdelay[f][clk]) << ((dqs * 2) + 16); - MCHBAR32_AND_OR(C0DQSDQRyTX3(rank), ~((1 << (dqs * 2 + 17)) | (1 << (dqs * 2 + 16))), + mchbar32_and_or(C0DQSDQRyTX3(rank), ~((1 << (dqs * 2 + 17)) | (1 << (dqs * 2 + 16))), reg32);
reg8 = pll->pi[f][clk]; - MCHBAR8_AND_OR(C0TXDQS0R0DLL + j, ~0x3f, reg8); + mchbar8_and_or(C0TXDQS0R0DLL + j, (u8)~0x3f, reg8); }
@@ -961,10 +962,10 @@ & ~((1 << (dq + 9)) | (1 << dq))) | reg32;
reg32 = ((u32) pll->clkdelay[f][clk]) << (dq*2); - MCHBAR32_AND_OR(C0DQSDQRyTX3(rank), ~((1 << (dq * 2 + 1)) | (1 << (dq * 2))), reg32); + mchbar32_and_or(C0DQSDQRyTX3(rank), ~((1 << (dq * 2 + 1)) | (1 << (dq * 2))), reg32);
reg8 = pll->pi[f][clk]; - MCHBAR8_AND_OR(C0TXDQ0R0DLL + j, ~0x3f, reg8); + mchbar8_and_or(C0TXDQ0R0DLL + j, (u8)~0x3f, reg8); }
/* WDLL programming: Perform HPLL/MPLL calibration after write levelization */ @@ -1055,8 +1056,8 @@ }
/* Disable Dynamic DQS Slave Setting Per Rank */ - MCHBAR8_AND(CSHRDQSCMN, ~(1 << 7)); - MCHBAR16_AND_OR(CSHRPDCTL4, ~0x3fff, 0x1fff); + mchbar8_and(CSHRDQSCMN, (u8)~(1 << 7)); + mchbar16_and_or(CSHRPDCTL4, (u16)~0x3fff, 0x1fff);
sdram_p_clkset0(&pll, f, 0); sdram_p_clkset1(&pll, f, 1); @@ -1079,13 +1080,13 @@ s->async = 0; reg8 = 0;
- MCHBAR16_OR(CSHRPDCTL, 1 << 15); - MCHBAR8_AND(CSHRPDCTL, ~(1 << 7)); - MCHBAR8_OR(CSHRPDCTL, 1 << 3); - MCHBAR8_OR(CSHRPDCTL, 1 << 2); + mchbar16_or(CSHRPDCTL, 1 << 15); + mchbar8_and(CSHRPDCTL, (u8)~(1 << 7)); + mchbar8_or(CSHRPDCTL, 1 << 3); + mchbar8_or(CSHRPDCTL, 1 << 2);
/* Start hardware HMC calibration */ - MCHBAR8_OR(CSHRPDCTL, 1 << 7); + mchbar8_or(CSHRPDCTL, 1 << 7);
/* Busy-wait until calibration is done */ while ((MCHBAR8(CSHRPDCTL) & (1 << 2)) == 0) @@ -1110,80 +1111,80 @@ } else { reg32 = 0x00014221; } - MCHBAR32_AND_OR(CSHRMSTRCTL1, ~0x0fffffff, reg32); - MCHBAR32_OR(CSHRMSTRCTL1, 1 << 23); - MCHBAR32_OR(CSHRMSTRCTL1, 1 << 15); - MCHBAR32_AND(CSHRMSTRCTL1, ~(1 << 15)); + mchbar32_and_or(CSHRMSTRCTL1, (u32)~0x0fffffff, reg32); + mchbar32_or(CSHRMSTRCTL1, 1 << 23); + mchbar32_or(CSHRMSTRCTL1, 1 << 15); + mchbar32_and(CSHRMSTRCTL1, (u32)~(1 << 15));
if (s->nodll) { /* Disable the Master DLLs by setting these bits, IN ORDER! */ - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 0); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 2); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 4); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 8); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 10); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 12); - MCHBAR16_OR(CSHRMSTRCTL0, 1 << 14); + mchbar16_or(CSHRMSTRCTL0, 1 << 0); + mchbar16_or(CSHRMSTRCTL0, 1 << 2); + mchbar16_or(CSHRMSTRCTL0, 1 << 4); + mchbar16_or(CSHRMSTRCTL0, 1 << 8); + mchbar16_or(CSHRMSTRCTL0, 1 << 10); + mchbar16_or(CSHRMSTRCTL0, 1 << 12); + mchbar16_or(CSHRMSTRCTL0, 1 << 14); } else { /* Enable the Master DLLs by clearing these bits, IN ORDER! */ - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 0)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 2)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 4)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 8)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 10)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 12)); - MCHBAR16_AND(CSHRMSTRCTL0, ~(1 << 14)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 0)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 2)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 4)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 8)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 10)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 12)); + mchbar16_and(CSHRMSTRCTL0, (u16)~(1 << 14)); }
/* Initialize the Transmit DLL PI values in the following sequence. */ if (s->nodll) { - MCHBAR8_AND_OR(CREFPI, ~0x3f, 0x07); + mchbar8_and_or(CREFPI, (u8)~0x3f, 0x07); } else { - MCHBAR8_AND(CREFPI, ~0x3f); + mchbar8_and(CREFPI, (u8)~0x3f); }
sdram_calibratepll(s, 0); // XXX check
/* Enable all modular Slave DLL */ - MCHBAR16_OR(C0DLLPIEN, 1 << 11); - MCHBAR16_OR(C0DLLPIEN, 1 << 12); + mchbar16_or(C0DLLPIEN, 1 << 11); + mchbar16_or(C0DLLPIEN, 1 << 12);
for (i = 0; i < 8; i++) { - MCHBAR16_OR(C0DLLPIEN, (1 << 10) >> i); + mchbar16_or(C0DLLPIEN, (1 << 10) >> i); } /* Enable DQ/DQS output */ - MCHBAR8_OR(C0SLVDLLOUTEN, 1); + mchbar8_or(C0SLVDLLOUTEN, 1); MCHBAR16(CSPDSLVWT) = 0x5005; - MCHBAR16_AND_OR(CSHRPDCTL2, ~0x1f1f, 0x051a); - MCHBAR16_AND_OR(CSHRPDCTL5, ~0xbf3f, 0x9010); + mchbar16_and_or(CSHRPDCTL2, (u16)~0x1f1f, 0x051a); + mchbar16_and_or(CSHRPDCTL5, (u16)~0xbf3f, 0x9010);
if (s->nodll) { - MCHBAR8_AND_OR(CSHRPDCTL3, ~0x7f, 0x6b); + mchbar8_and_or(CSHRPDCTL3, (u8)~0x7f, 0x6b); } else { - MCHBAR8_AND_OR(CSHRPDCTL3, ~0x7f, 0x55); + mchbar8_and_or(CSHRPDCTL3, (u8)~0x7f, 0x55); sdram_calibratehwpll(s); } /* Disable Dynamic Diff Amp */ - MCHBAR32_AND(C0STATRDCTRL, ~(1 << 22)); + mchbar32_and(C0STATRDCTRL, (u32)~(1 << 22));
/* Now, start initializing the transmit FIFO */ - MCHBAR8_AND(C0MISCCTL, ~0x02); + mchbar8_and(C0MISCCTL, (u8)~0x02);
/* Disable (gate) mdclk and mdclkb */ - MCHBAR8_OR(CSHWRIOBONUS, 0xc0); + mchbar8_or(CSHWRIOBONUS, 0xc0);
/* Select mdmclk */ - MCHBAR8_AND(CSHWRIOBONUS, ~(1 << 5)); + mchbar8_and(CSHWRIOBONUS, (u8)~(1 << 5));
/* Ungate mdclk */ - MCHBAR8_AND_OR(CSHWRIOBONUS, ~0xc0, 1 << 6); - MCHBAR8_AND_OR(CSHRFIFOCTL, ~0x3f, 0x1a); + mchbar8_and_or(CSHWRIOBONUS, (u8)~0xc0, 1 << 6); + mchbar8_and_or(CSHRFIFOCTL, (u8)~0x3f, 0x1a);
/* Enable the write pointer count */ - MCHBAR8_OR(CSHRFIFOCTL, 1); + mchbar8_or(CSHRFIFOCTL, 1);
/* Set the DDR3 Reset Enable bit */ - MCHBAR8_OR(CSHRDDR3CTL, 1); + mchbar8_or(CSHRDDR3CTL, 1);
/* Configure DQS-DQ Transmit */ MCHBAR32(CSHRDQSTXPGM) = 0x00551803; @@ -1191,10 +1192,10 @@ reg8 = 0; /* Switch all clocks on anyway */
/* Enable clock groups depending on rank population */ - MCHBAR32_AND_OR(C0CKTX, ~0x3f000000, reg8 << 24); + mchbar32_and_or(C0CKTX, (u32)~0x3f000000, reg8 << 24);
/* Enable DDR command output buffers from core */ - MCHBAR8_AND(0x594, ~1); + mchbar8_and(0x594, (u8)~1);
reg16 = 0; if (!rank_is_populated(s->dimms, 0, 0)) { @@ -1209,7 +1210,7 @@ if (!rank_is_populated(s->dimms, 0, 3)) { reg16 |= (1 << 11) | (1 << 7) | (1 << 3); } - MCHBAR16_OR(C0CTLTX2, reg16); + mchbar16_or(C0CTLTX2, reg16); }
/* Define a shorter name for these to make the lines fit in 96 characters */ @@ -1344,54 +1345,54 @@
FOR_EACH_RCOMP_GROUP(i) { reg8 = rcompupdate[i]; - MCHBAR8_AND_OR(C0RCOMPCTRLx(i), ~1, reg8); - MCHBAR8_AND(C0RCOMPCTRLx(i), ~2); + mchbar8_and_or(C0RCOMPCTRLx(i), (u8)~1, reg8); + mchbar8_and(C0RCOMPCTRLx(i), (u8)~2);
reg16 = rcompslew; - MCHBAR16_AND_OR(C0RCOMPCTRLx(i), ~0xf000, reg16 << 12); + mchbar16_and_or(C0RCOMPCTRLx(i), (u16)~0xf000, reg16 << 12);
MCHBAR8(C0RCOMPMULTx(i)) = rcompstr[i]; MCHBAR16(C0SCOMPVREFx(i)) = rcompscomp[i]; - MCHBAR8_AND_OR(C0DCOMPx(i), ~0x03, rcompdelay[i]); + mchbar8_and_or(C0DCOMPx(i), (u8)~0x03, rcompdelay[i]); if (i == 2) { /* FIXME: Why are we rewriting this? */ - MCHBAR16_AND_OR(C0RCOMPCTRLx(i), ~0xf000, reg16 << 12); + mchbar16_and_or(C0RCOMPCTRLx(i), (u16)~0xf000, reg16 << 12);
MCHBAR8(C0RCOMPMULTx(i)) = rcompstr2[s->dimm_config[0]]; MCHBAR16(C0SCOMPVREFx(i)) = rcompscomp2[s->dimm_config[0]]; - MCHBAR8_AND_OR(C0DCOMPx(i), ~0x03, rcompdelay2[s->dimm_config[0]]); + mchbar8_and_or(C0DCOMPx(i), (u8)~0x03, rcompdelay2[s->dimm_config[0]]); }
- MCHBAR16_AND(C0SLEWBASEx(i), ~0x7f7f); + mchbar16_and(C0SLEWBASEx(i), (u16)~0x7f7f);
/* FIXME: Why not do a single dword write? */ - MCHBAR16_AND(C0SLEWPULUTx(i), ~0x3f3f); - MCHBAR16_AND(C0SLEWPULUTx(i) + 2, ~0x3f3f); + mchbar16_and(C0SLEWPULUTx(i), (u16)~0x3f3f); + mchbar16_and(C0SLEWPULUTx(i) + 2, (u16)~0x3f3f);
/* FIXME: Why not do a single dword write? */ - MCHBAR16_AND(C0SLEWPDLUTx(i), ~0x3f3f); - MCHBAR16_AND(C0SLEWPDLUTx(i) + 2, ~0x3f3f); + mchbar16_and(C0SLEWPDLUTx(i), (u16)~0x3f3f); + mchbar16_and(C0SLEWPDLUTx(i) + 2, (u16)~0x3f3f); }
/* FIXME: Hardcoded */ - MCHBAR8_AND_OR(C0ODTRECORDX, ~0x3f, 0x36); - MCHBAR8_AND_OR(C0DQSODTRECORDX, ~0x3f, 0x36); + mchbar8_and_or(C0ODTRECORDX, (u8)~0x3f, 0x36); + mchbar8_and_or(C0DQSODTRECORDX, (u8)~0x3f, 0x36);
FOR_EACH_RCOMP_GROUP(i) { - MCHBAR8_AND(C0RCOMPCTRLx(i), ~0x60); - MCHBAR16_AND(C0RCOMPCTRLx(i) + 2, ~0x0706); - MCHBAR16_AND(C0RCOMPOSVx(i), ~0x7f7f); - MCHBAR16_AND(C0SCOMPOFFx(i), ~0x3f3f); - MCHBAR16_AND(C0DCOMPOFFx(i), ~0x1f1f); - MCHBAR8_AND(C0DCOMPOFFx(i) + 2, ~0x1f); + mchbar8_and(C0RCOMPCTRLx(i), (u8)~0x60); + mchbar16_and(C0RCOMPCTRLx(i) + 2, (u16)~0x0706); + mchbar16_and(C0RCOMPOSVx(i), (u16)~0x7f7f); + mchbar16_and(C0SCOMPOFFx(i), (u16)~0x3f3f); + mchbar16_and(C0DCOMPOFFx(i), (u16)~0x1f1f); + mchbar8_and(C0DCOMPOFFx(i) + 2, (u8)~0x1f); }
- MCHBAR16_AND(C0ODTRECORDX, ~0xffc0); - MCHBAR16_AND(C0ODTRECORDX + 2, ~0x000f); + mchbar16_and(C0ODTRECORDX, (u16)~0xffc0); + mchbar16_and(C0ODTRECORDX + 2, (u16)~0x000f);
/* FIXME: Why not do a single dword write? */ - MCHBAR16_AND(C0DQSODTRECORDX, ~0xffc0); - MCHBAR16_AND(C0DQSODTRECORDX + 2, ~0x000f); + mchbar16_and(C0DQSODTRECORDX, (u16)~0xffc0); + mchbar16_and(C0DQSODTRECORDX + 2, (u16)~0x000f);
FOR_EACH_RCOMP_GROUP(i) { MCHBAR16(C0SCOMPOVRx(i)) = rcompf[i]; @@ -1401,33 +1402,33 @@ MCHBAR16(C0DCOMPOVRx(i) + 2) = 0x000C; }
- MCHBAR32_AND_OR(DCMEASBUFOVR, ~0x001f1f1f, 0x000c1219); + mchbar32_and_or(DCMEASBUFOVR, (u32)~0x001f1f1f, 0x000c1219);
/* FIXME: Why not do a single word write? */ - MCHBAR16_AND_OR(XCOMPSDR0BNS, ~0x1f00, 0x1200); - MCHBAR8_AND_OR(XCOMPSDR0BNS, ~0x1f, 0x12); + mchbar16_and_or(XCOMPSDR0BNS, (u16)~0x1f00, 0x1200); + mchbar8_and_or(XCOMPSDR0BNS, (u8)~0x1f, 0x12);
MCHBAR32(COMPCTRL3) = 0x007C9007; MCHBAR32(OFREQDELSEL) = rcomp1; MCHBAR16(XCOMPCMNBNS) = 0x1f7f; MCHBAR32(COMPCTRL2) = rcomp2; - MCHBAR16_AND_OR(XCOMPDFCTRL, ~0x0f, 1); + mchbar16_and_or(XCOMPDFCTRL, (u16)~0x0f, 1); MCHBAR16(ZQCALCTRL) = 0x0134; MCHBAR32(COMPCTRL1) = 0x4C293600;
/* FIXME: wtf did these MRC guys smoke */ - MCHBAR8_AND_OR(COMPCTRL1 + 3, ~0x44, (1 << 6) | (1 << 2)); - MCHBAR16_AND(XCOMPSDR0BNS, ~(1 << 13)); - MCHBAR8_AND(XCOMPSDR0BNS, ~(1 << 5)); + mchbar8_and_or(COMPCTRL1 + 3, (u8)~0x44, (1 << 6) | (1 << 2)); + mchbar16_and(XCOMPSDR0BNS, (u16)~(1 << 13)); + mchbar8_and(XCOMPSDR0BNS, (u8)~(1 << 5));
FOR_EACH_RCOMP_GROUP(i) { /* FIXME: This should be an _AND_OR */ - MCHBAR8(C0RCOMPCTRLx(i) + 2) = MCHBAR8(C0RCOMPCTRLx(i)) & ~0x71; + MCHBAR8(C0RCOMPCTRLx(i) + 2) = MCHBAR8(C0RCOMPCTRLx(i)) & (u8)~0x71; }
if ((MCHBAR32(COMPCTRL1) & (1 << 30)) == 0) { /* Start COMP */ - MCHBAR8_OR(COMPCTRL1, 1); + mchbar8_or(COMPCTRL1, 1);
/* Wait until COMP is done */ while ((MCHBAR8(COMPCTRL1) & 1) != 0) @@ -1443,55 +1444,55 @@
/* FIXME: Why not do a single word write? */ reg16 = (u16)(rcompp - (1 << (srup + 1))) << 8; - MCHBAR16_AND_OR(C0SLEWBASEx(i), ~0x7f00, reg16); + mchbar16_and_or(C0SLEWBASEx(i), (u16)~0x7f00, reg16);
reg16 = (u16)(rcompn - (1 << (srun + 1))); - MCHBAR8_AND_OR(C0SLEWBASEx(i), ~0x7f, (u8)reg16); + mchbar8_and_or(C0SLEWBASEx(i), (u8)~0x7f, (u8)reg16); }
reg8 = rcompp - (1 << (srup + 1)); for (i = 0, j = reg8; i < 4; i++, j += (1 << srup)) { - MCHBAR8_AND_OR(C0SLEWPULUTx(0) + i, ~0x3f, rcomplut[j][0]); + mchbar8_and_or(C0SLEWPULUTx(0) + i, (u8)~0x3f, rcomplut[j][0]); }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srup)) { if (s->dimm_config[0] < 3 || s->dimm_config[0] == 5) { - MCHBAR8_AND_OR(C0SLEWPULUTx(2) + i, ~0x3f, rcomplut[j][10]); + mchbar8_and_or(C0SLEWPULUTx(2) + i, (u8)~0x3f, rcomplut[j][10]); } }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srup)) { - MCHBAR8_AND_OR(C0SLEWPULUTx(3) + i, ~0x3f, rcomplut[j][6]); - MCHBAR8_AND_OR(C0SLEWPULUTx(4) + i, ~0x3f, rcomplut[j][6]); + mchbar8_and_or(C0SLEWPULUTx(3) + i, (u8)~0x3f, rcomplut[j][6]); + mchbar8_and_or(C0SLEWPULUTx(4) + i, (u8)~0x3f, rcomplut[j][6]); }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srup)) { - MCHBAR8_AND_OR(C0SLEWPULUTx(5) + i, ~0x3f, rcomplut[j][8]); - MCHBAR8_AND_OR(C0SLEWPULUTx(6) + i, ~0x3f, rcomplut[j][8]); + mchbar8_and_or(C0SLEWPULUTx(5) + i, (u8)~0x3f, rcomplut[j][8]); + mchbar8_and_or(C0SLEWPULUTx(6) + i, (u8)~0x3f, rcomplut[j][8]); }
reg8 = rcompn - (1 << (srun + 1)); for (i = 0, j = reg8; i < 4; i++, j += (1 << srun)) { - MCHBAR8_AND_OR(C0SLEWPDLUTx(0) + i, ~0x3f, rcomplut[j][1]); + mchbar8_and_or(C0SLEWPDLUTx(0) + i, (u8)~0x3f, rcomplut[j][1]); }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srun)) { if (s->dimm_config[0] < 3 || s->dimm_config[0] == 5) { - MCHBAR8_AND_OR(C0SLEWPDLUTx(2) + i, ~0x3f, rcomplut[j][11]); + mchbar8_and_or(C0SLEWPDLUTx(2) + i, (u8)~0x3f, rcomplut[j][11]); } }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srun)) { - MCHBAR8_AND_OR(C0SLEWPDLUTx(3) + i, ~0x3f, rcomplut[j][7]); - MCHBAR8_AND_OR(C0SLEWPDLUTx(4) + i, ~0x3f, rcomplut[j][7]); + mchbar8_and_or(C0SLEWPDLUTx(3) + i, (u8)~0x3f, rcomplut[j][7]); + mchbar8_and_or(C0SLEWPDLUTx(4) + i, (u8)~0x3f, rcomplut[j][7]); }
for (i = 0, j = reg8; i < 4; i++, j += (1 << srun)) { - MCHBAR8_AND_OR(C0SLEWPDLUTx(5) + i, ~0x3f, rcomplut[j][9]); - MCHBAR8_AND_OR(C0SLEWPDLUTx(6) + i, ~0x3f, rcomplut[j][9]); + mchbar8_and_or(C0SLEWPDLUTx(5) + i, (u8)~0x3f, rcomplut[j][9]); + mchbar8_and_or(C0SLEWPDLUTx(6) + i, (u8)~0x3f, rcomplut[j][9]); } } - MCHBAR8_OR(COMPCTRL1, 1); + mchbar8_or(COMPCTRL1, 1); }
/* FIXME: The ODT tables are for DDR2 only! */ @@ -1566,24 +1567,24 @@ if ((s->dimm_config[0] < 3) && rank_is_populated(s->dimms, 0, 0)) { if (s->dimms[0].sides > 1) { // 2R/NC - MCHBAR32_AND_OR(C0CKECTRL, ~1, 0x300001); + mchbar32_and_or(C0CKECTRL, (u32)~1, 0x300001); MCHBAR32(C0DRA01) = 0x00000101; MCHBAR32(C0DRB0) = 0x00040002; MCHBAR32(C0DRB2) = w204[s->dimm_config[0]]; } else { // 1R/NC - MCHBAR32_AND_OR(C0CKECTRL, ~1, 0x100001); + mchbar32_and_or(C0CKECTRL, (u32)~1, 0x100001); MCHBAR32(C0DRA01) = 0x00000001; MCHBAR32(C0DRB0) = 0x00020002; MCHBAR32(C0DRB2) = w204[s->dimm_config[0]]; } } else if ((s->dimm_config[0] == 5) && rank_is_populated(s->dimms, 0, 0)) { - MCHBAR32_AND_OR(C0CKECTRL, ~1, 0x300001); + mchbar32_and_or(C0CKECTRL, (u32)~1, 0x300001); MCHBAR32(C0DRA01) = 0x00000101; MCHBAR32(C0DRB0) = 0x00040002; MCHBAR32(C0DRB2) = 0x00040004; } else { - MCHBAR32_AND_OR(C0CKECTRL, ~1, w260[s->dimm_config[0]]); + mchbar32_and_or(C0CKECTRL, (u32)~1, w260[s->dimm_config[0]]); MCHBAR32(C0DRA01) = w208[s->dimm_config[0]]; MCHBAR32(C0DRB0) = w200[s->dimm_config[0]]; MCHBAR32(C0DRB2) = w204[s->dimm_config[0]]; @@ -1652,10 +1653,10 @@ u32 reg32a, reg32b;
ok = 0; - MCHBAR8_AND(XCOMPDFCTRL, ~(1 << 3)); - MCHBAR8_AND(COMPCTRL1, ~(1 << 7)); + mchbar8_and(XCOMPDFCTRL, (u8)~(1 << 3)); + mchbar8_and(COMPCTRL1, (u8)~(1 << 7)); for (i = 0; i < 3; i++) { - MCHBAR8_OR(COMPCTRL1, 1); + mchbar8_or(COMPCTRL1, 1); hpet_udelay(1000); while ((MCHBAR8(COMPCTRL1) & 1) != 0) ; @@ -1668,7 +1669,7 @@ reg32a |= (1 << 31) | (1 << 15); MCHBAR32(RCMEASBUFXOVR) = reg32a; } - MCHBAR8_OR(COMPCTRL1, 1); + mchbar8_or(COMPCTRL1, 1); hpet_udelay(1000); while ((MCHBAR8(COMPCTRL1) & 1) != 0) ; @@ -1681,7 +1682,7 @@
reg32 = jval << 3; reg32 |= rank * (1 << 27); - MCHBAR8_AND_OR(C0JEDEC, ~0x3e, jmode); + mchbar8_and_or(C0JEDEC, (u8)~0x3e, jmode); read32((void *)reg32); barrier(); hpet_udelay(1); // 1us @@ -1690,10 +1691,10 @@ static void sdram_zqcl(struct sysinfo *s) { if (s->boot_path == BOOT_PATH_RESUME) { - MCHBAR32_OR(C0CKECTRL, 1 << 27); - MCHBAR8_AND_OR(C0JEDEC, ~0x0e, NORMAL_OP_CMD); - MCHBAR8_AND(C0JEDEC, ~0x30); - MCHBAR32_AND_OR(C0REFRCTRL2, ~(3 << 30), 3 << 30); + mchbar32_or(C0CKECTRL, 1 << 27); + mchbar8_and_or(C0JEDEC, (u8)~0x0e, NORMAL_OP_CMD); + mchbar8_and(C0JEDEC, (u8)~0x30); + mchbar32_and_or(C0REFRCTRL2, (u32)~(3 << 30), 3 << 30); } }
@@ -1759,12 +1760,12 @@ reg32 = 0; reg32 |= (4 << 13); reg32 |= (6 << 8); - MCHBAR32_AND_OR(C0DYNRDCTRL, ~0x3ff00, reg32); - MCHBAR8_AND(C0DYNRDCTRL, ~(1 << 7)); - MCHBAR8_OR(C0REFRCTRL + 3, 1); + mchbar32_and_or(C0DYNRDCTRL, (u32)~0x3ff00, reg32); + mchbar8_and(C0DYNRDCTRL, (u8)~(1 << 7)); + mchbar8_or(C0REFRCTRL + 3, 1); if (s->boot_path != BOOT_PATH_RESUME) { - MCHBAR8_AND_OR(C0JEDEC, ~0x0e, NORMAL_OP_CMD); - MCHBAR8_AND(C0JEDEC, ~0x30); + mchbar8_and_or(C0JEDEC, (u8)~0x0e, NORMAL_OP_CMD); + mchbar8_and(C0JEDEC, (u8)~0x30); } else { sdram_zqcl(s); } @@ -1861,10 +1862,10 @@ reg32 |= (1 << r); } reg8 = (u8)(reg32 << 4) & 0xf0; - MCHBAR8_AND_OR(C0CKECTRL + 2, ~0xf0, reg8); + mchbar8_and_or(C0CKECTRL + 2, (u8)~0xf0, reg8);
if (ONLY_DIMMA_IS_POPULATED(s->dimms, 0) || ONLY_DIMMB_IS_POPULATED(s->dimms, 0)) { - MCHBAR8_OR(C0CKECTRL, 1); + mchbar8_or(C0CKECTRL, 1); }
addr = C0DRB0; @@ -1885,9 +1886,9 @@ { u8 dqsmatches = 1; while (count--) { - MCHBAR8_AND(C0RSTCTL, ~2); + mchbar8_and(C0RSTCTL, (u8)~2); hpet_udelay(1); - MCHBAR8_OR(C0RSTCTL, 2); + mchbar8_or(C0RSTCTL, 2); hpet_udelay(1); barrier(); read32((void *)strobeaddr); @@ -1906,12 +1907,12 @@ { if (*medium < 3) { (*medium)++; - MCHBAR16_AND_OR(C0RCVMISCCTL2, (u16)~(3 << (lane * 2)), *medium << (lane * 2)); + mchbar16_and_or(C0RCVMISCCTL2, (u16)~(3 << (lane * 2)), *medium << (lane * 2)); } else { *medium = 0; (*coarse)++; - MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, *coarse << 16); - MCHBAR16_AND_OR(C0RCVMISCCTL2, (u16)(~3 << (lane * 2)), *medium << (lane * 2)); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, *coarse << 16); + mchbar16_and_or(C0RCVMISCCTL2, (u16)(~3 << (lane * 2)), *medium << (lane * 2)); } }
@@ -1930,8 +1931,8 @@ u32 strobeaddr = 0; u32 dqshighaddr;
- MCHBAR8_AND(C0RSTCTL, ~0x0c); - MCHBAR8_AND(CMNDQFIFORST, ~0x80); + mchbar8_and(C0RSTCTL, (u8)~0x0c); + mchbar8_and(CMNDQFIFORST, (u8)~0x80);
PRINTK_DEBUG("rcven 0\n"); for (lane = 0; lane < maxlane; lane++) { @@ -1943,10 +1944,10 @@ pi = 0; medium = 0;
- MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, coarse << 16); - MCHBAR16_AND_OR(C0RCVMISCCTL2, (u16)~(3 << (lane * 2)), medium << (lane * 2)); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, coarse << 16); + mchbar16_and_or(C0RCVMISCCTL2, (u16)~(3 << (lane * 2)), medium << (lane * 2));
- MCHBAR8_AND(C0RXRCVyDLL(lane), ~0x3f); + mchbar8_and(C0RXRCVyDLL(lane), (u8)~0x3f);
savecoarse = coarse; savemedium = medium; @@ -1955,7 +1956,7 @@ PRINTK_DEBUG("rcven 0.1\n");
// XXX comment out - // MCHBAR16_AND_OR(C0RCVMISCCTL1, (u16)~3 << (lane * 2), 1 << (lane * 2)); + // mchbar16_and_or(C0RCVMISCCTL1, (u16)~3 << (lane * 2), 1 << (lane * 2));
while (sampledqs(dqshighaddr, strobeaddr, 0, 3) == 0) { // printk(BIOS_DEBUG, "coarse=%d medium=%d\n", coarse, medium); @@ -1986,8 +1987,8 @@ PRINTK_DEBUG("rcven 0.3\n"); coarse = savecoarse; medium = savemedium; - MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, coarse << 16); - MCHBAR16_AND_OR(C0RCVMISCCTL2, (u16)~(0x3 << lane * 2), medium << (lane * 2)); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, coarse << 16); + mchbar16_and_or(C0RCVMISCCTL2, (u16)~(0x3 << lane * 2), medium << (lane * 2));
while (sampledqs(dqshighaddr, strobeaddr, 1, 3) == 0) { savepi = pi; @@ -1998,12 +1999,12 @@ break; // } } - MCHBAR8_AND_OR(C0RXRCVyDLL(lane), ~0x3f, pi << s->pioffset); + mchbar8_and_or(C0RXRCVyDLL(lane), (u8)~0x3f, pi << s->pioffset); } PRINTK_DEBUG("rcven 0.4\n");
pi = savepi; - MCHBAR8_AND_OR(C0RXRCVyDLL(lane), ~0x3f, pi << s->pioffset); + mchbar8_and_or(C0RXRCVyDLL(lane), (u8)~0x3f, pi << s->pioffset); rcvenclock(&coarse, &medium, lane);
if (sampledqs(dqshighaddr, strobeaddr, 1, 1) == 0) { @@ -2013,7 +2014,7 @@ PRINTK_DEBUG("rcven 0.5\n"); while (sampledqs(dqshighaddr, strobeaddr, 0, 3) == 0) { coarse--; - MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, coarse << 16); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, coarse << 16); if (coarse == 0) { PRINTK_DEBUG("Error: DQS did not hit 0\n"); break; @@ -2040,10 +2041,10 @@ do { lane--; offset = lanecoarse[lane] - minlanecoarse; - MCHBAR16_AND_OR(C0COARSEDLY0, (u16)(~(3 << (lane * 2))), offset << (lane * 2)); + mchbar16_and_or(C0COARSEDLY0, (u16)(~(3 << (lane * 2))), offset << (lane * 2)); } while (lane != 0);
- MCHBAR32_AND_OR(C0STATRDCTRL, ~0x000f0000, minlanecoarse << 16); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x000f0000, minlanecoarse << 16);
s->coarsectrl = minlanecoarse; s->coarsedelay = MCHBAR16(C0COARSEDLY0); @@ -2051,14 +2052,14 @@ s->readptrdelay = MCHBAR16(C0RCVMISCCTL1);
PRINTK_DEBUG("rcven 2\n"); - MCHBAR8_AND(C0RSTCTL, ~0x0e); - MCHBAR8_OR(C0RSTCTL, 0x02); - MCHBAR8_OR(C0RSTCTL, 0x04); - MCHBAR8_OR(C0RSTCTL, 0x08); + mchbar8_and(C0RSTCTL, (u8)~0x0e); + mchbar8_or(C0RSTCTL, 0x02); + mchbar8_or(C0RSTCTL, 0x04); + mchbar8_or(C0RSTCTL, 0x08);
- MCHBAR8_OR(CMNDQFIFORST, 0x80); - MCHBAR8_AND(CMNDQFIFORST, ~0x80); - MCHBAR8_OR(CMNDQFIFORST, 0x80); + mchbar8_or(CMNDQFIFORST, 0x80); + mchbar8_and(CMNDQFIFORST, (u8)~0x80); + mchbar8_or(CMNDQFIFORST, 0x80); PRINTK_DEBUG("rcven 3\n"); }
@@ -2138,20 +2139,20 @@ { u8 reg8, ch, r, fsb_freq, ddr_freq; u32 mask32, reg32; - MCHBAR8_OR(C0ADDCSCTRL, 1); - MCHBAR8_OR(C0REFRCTRL + 3, 1); + mchbar8_or(C0ADDCSCTRL, 1); + mchbar8_or(C0REFRCTRL + 3, 1); mask32 = (0x1f << 15) | (0x1f << 10) | (0x1f << 5) | 0x1f; reg32 = (0x1e << 15) | (0x10 << 10) | (0x1e << 5) | 0x10; - MCHBAR32_AND_OR(WRWMCONFIG, ~mask32, reg32); + mchbar32_and_or(WRWMCONFIG, (u32)~mask32, reg32); MCHBAR8(C0DITCTRL + 1) = 2; MCHBAR16(C0DITCTRL + 2) = 0x0804; MCHBAR16(C0DITCTRL + 4) = 0x2010; MCHBAR8(C0DITCTRL + 6) = 0x40; MCHBAR16(C0DITCTRL + 8) = 0x091c; MCHBAR8(C0DITCTRL + 10) = 0xf2; - MCHBAR8_OR(C0BYPCTRL, 1); - MCHBAR8_OR(C0CWBCTRL, 1); - MCHBAR16_OR(C0ARBSPL, 0x0100); + mchbar8_or(C0BYPCTRL, 1); + mchbar8_or(C0CWBCTRL, 1); + mchbar16_or(C0ARBSPL, 0x0100);
pci_or_config8(HOST_BRIDGE, 0xf0, 1); MCHBAR32(SBCTL) = 0x00000002; @@ -2162,7 +2163,7 @@ MCHBAR32(HIT2) = 0x07000000; MCHBAR32(HIT3) = 0x01014010; MCHBAR32(HIT4) = 0x0f038000; - pci_and_config8(HOST_BRIDGE, 0xf0, ~1); + pci_and_config8(HOST_BRIDGE, 0xf0, (u8)~1);
u32 nranks, curranksize, maxranksize, dra; u8 rankmismatch; @@ -2209,14 +2210,14 @@ die("Invalid number of ranks found, halt\n"); break; } - MCHBAR8_AND_OR(CHDECMISC, ~0xfc, reg8 & 0xfc); - MCHBAR32_AND(NOACFGBUSCTL, ~0x80000000); + mchbar8_and_or(CHDECMISC, (u8)~0xfc, reg8 & 0xfc); + mchbar32_and(NOACFGBUSCTL, (u32)~0x80000000);
MCHBAR32(HTBONUS0) = 0x0000000f; - MCHBAR8_OR(C0COREBONUS + 4, 1); + mchbar8_or(C0COREBONUS + 4, 1);
- MCHBAR32_AND(HIT3, ~0x0e000000); - MCHBAR32_AND_OR(HIT4, ~0x000c0000, 0x00040000); + mchbar32_and(HIT3, (u32)~0x0e000000); + mchbar32_and_or(HIT4, (u32)~0x000c0000, 0x00040000);
u32 clkcx[2][2][3] = { { @@ -2236,20 +2237,20 @@ MCHBAR32(CLKXSSH2X2MD + 4) = clkcx[fsb_freq][ddr_freq][1]; MCHBAR32(CLKXSSH2MCBYP + 4) = clkcx[fsb_freq][ddr_freq][2];
- MCHBAR8_AND(HIT4, ~0x02); + mchbar8_and(HIT4, (u8)~0x02); }
static void sdram_periodic_rcomp(void) { - MCHBAR8_AND(COMPCTRL1, ~0x02); + mchbar8_and(COMPCTRL1, (u8)~0x02); while ((MCHBAR32(COMPCTRL1) & 0x80000000) > 0) { ; } - MCHBAR16_AND(CSHRMISCCTL, ~0x3000); - MCHBAR8_OR(CMNDQFIFORST, 0x80); - MCHBAR16_AND_OR(XCOMPDFCTRL, ~0x0f, 0x09); + mchbar16_and(CSHRMISCCTL, (u16)~0x3000); + mchbar8_or(CMNDQFIFORST, 0x80); + mchbar16_and_or(XCOMPDFCTRL, (u16)~0x0f, 0x09);
- MCHBAR8_OR(COMPCTRL1, 0x82); + mchbar8_or(COMPCTRL1, 0x82); }
static void sdram_new_trd(struct sysinfo *s) @@ -2337,7 +2338,7 @@ } }
- MCHBAR16_AND_OR(C0STATRDCTRL, ~0x1f00, trd << 8); + mchbar16_and_or(C0STATRDCTRL, (u16)~0x1f00, trd << 8); }
static void sdram_powersettings(struct sysinfo *s) @@ -2347,26 +2348,26 @@
/* Thermal sensor */ MCHBAR8(TSC1) = 0x9b; - MCHBAR32_AND_OR(TSTTP, ~0x00ffffff, 0x1d00); + mchbar32_and_or(TSTTP, (u32)~0x00ffffff, 0x1d00); MCHBAR8(THERM1) = 0x08; MCHBAR8(TSC3) = 0x00; - MCHBAR8_AND_OR(TSC2, ~0x0f, 0x04); - MCHBAR8_AND_OR(THERM1, ~1, 1); - MCHBAR8_AND_OR(TCO, ~0x80, 0x80); + mchbar8_and_or(TSC2, (u8)~0x0f, 0x04); + mchbar8_and_or(THERM1, (u8)~1, 1); + mchbar8_and_or(TCO, (u8)~0x80, 0x80);
/* Clock gating */ - MCHBAR32_AND(PMMISC, ~0x00040001); - MCHBAR8_AND(SBCTL3 + 3, ~0x80); - MCHBAR8_AND(CISDCTRL + 3, ~0x80); - MCHBAR16_AND(CICGDIS, ~0x1fff); - MCHBAR32_AND(SBCLKGATECTRL, ~0x0001ffff); - MCHBAR16_AND(HICLKGTCTL, ~0x03ff & 0x06); - MCHBAR32_AND_OR(HTCLKGTCTL, ~0xffffffff, 0x20); - MCHBAR8_AND(TSMISC, ~1); + mchbar32_and(PMMISC, (u32)~0x00040001); + mchbar8_and(SBCTL3 + 3, (u8)~0x80); + mchbar8_and(CISDCTRL + 3, (u8)~0x80); + mchbar16_and(CICGDIS, (u16)~0x1fff); + mchbar32_and(SBCLKGATECTRL, (u32)~0x0001ffff); + mchbar16_and(HICLKGTCTL, (u16)~0x03ff & 0x06); + mchbar32_and_or(HTCLKGTCTL, (u32)~0xffffffff, 0x20); + mchbar8_and(TSMISC, (u8)~1); MCHBAR8(C0WRDPYN) = s->selected_timings.CAS - 1 + 0x15; - MCHBAR16_AND_OR(CLOCKGATINGI, ~0x07fc, 0x0040); - MCHBAR16_AND_OR(CLOCKGATINGII, ~0x0fff, 0x0d00); - MCHBAR16_AND(CLOCKGATINGIII, ~0x0d80); + mchbar16_and_or(CLOCKGATINGI, (u16)~0x07fc, 0x0040); + mchbar16_and_or(CLOCKGATINGII, (u16)~0x0fff, 0x0d00); + mchbar16_and(CLOCKGATINGIII, (u16)~0x0d80); MCHBAR16(GTDPCGC + 2) = 0xffff;
/* Sequencing */ @@ -2379,15 +2380,15 @@ MCHBAR32(PMDSLFRC) = (MCHBAR32(PMDSLFRC) & ~0x0001bff7) | 0x00000078;
if (s->selected_timings.fsb_clock == FSB_CLOCK_667MHz) - MCHBAR16_AND_OR(PMMSPMRES, ~0x03ff, 0x00c8); + mchbar16_and_or(PMMSPMRES, (u16)~0x03ff, 0x00c8); else - MCHBAR16_AND_OR(PMMSPMRES, ~0x03ff, 0x0100); + mchbar16_and_or(PMMSPMRES, (u16)~0x03ff, 0x0100);
j = (s->selected_timings.mem_clock == MEM_CLOCK_667MHz) ? 0 : 1;
- MCHBAR32_AND_OR(PMCLKRC, ~0x01fff37f, 0x10810700); - MCHBAR8_AND_OR(PMPXPRC, ~0x07, 1); - MCHBAR8_AND(PMBAK, ~0x02); + mchbar32_and_or(PMCLKRC, (u32)~0x01fff37f, 0x10810700); + mchbar8_and_or(PMPXPRC, (u8)~0x07, 1); + mchbar8_and(PMBAK, (u8)~0x02);
static const u16 ddr2lut[2][4][2] = { { @@ -2407,8 +2408,8 @@ MCHBAR16(C0C2REG) = 0x7a89; MCHBAR8(SHC2REGII) = 0xaa; MCHBAR16(SHC2REGII + 1) = ddr2lut[j][s->selected_timings.CAS - 3][1]; - MCHBAR16_AND_OR(SHC2REGI, ~0x7fff, ddr2lut[j][s->selected_timings.CAS - 3][0]); - MCHBAR16_AND_OR(CLOCKGATINGIII, ~0xf000, 0xf000); + mchbar16_and_or(SHC2REGI, (u16)~0x7fff, ddr2lut[j][s->selected_timings.CAS - 3][0]); + mchbar16_and_or(CLOCKGATINGIII, (u16)~0xf000, 0xf000); MCHBAR8(CSHWRIOBONUSX) = (MCHBAR8(CSHWRIOBONUSX) & ~0x77) | (4 << 4 | 4);
reg32 = s->nodll ? 0x30000000 : 0; @@ -2416,72 +2417,72 @@ /* FIXME: Compacting this results in changes to the binary */ MCHBAR32(C0COREBONUS) = (MCHBAR32(C0COREBONUS) & ~0x0f000000) | 0x20000000 | reg32;
- MCHBAR32_AND_OR(CLOCKGATINGI, ~0x00f00000, 0x00f00000); - MCHBAR32_AND_OR(CLOCKGATINGII - 1, ~0x001ff000, 0xbf << 20); - MCHBAR16_AND_OR(SHC3C4REG2, ~0x1f7f, (0x0b << 8) | (7 << 4) | 0x0b); + mchbar32_and_or(CLOCKGATINGI, (u32)~0x00f00000, 0x00f00000); + mchbar32_and_or(CLOCKGATINGII - 1, (u32)~0x001ff000, 0xbf << 20); + mchbar16_and_or(SHC3C4REG2, (u16)~0x1f7f, (0x0b << 8) | (7 << 4) | 0x0b); MCHBAR16(SHC3C4REG3) = 0x3264; - MCHBAR16_AND_OR(SHC3C4REG4, ~0x3f3f, (0x14 << 8) | 0x0a); + mchbar16_and_or(SHC3C4REG4, (u16)~0x3f3f, (0x14 << 8) | 0x0a);
- MCHBAR32_OR(C1COREBONUS, 0x80002000); + mchbar32_or(C1COREBONUS, 0x80002000); }
static void sdram_programddr(void) { - MCHBAR16_AND_OR(CLOCKGATINGII, ~0x03ff, 0x0100); - MCHBAR16_AND_OR(CLOCKGATINGIII, ~0x003f, 0x0010); - MCHBAR16_AND_OR(CLOCKGATINGI, ~0x7000, 0x2000); + mchbar16_and_or(CLOCKGATINGII, (u16)~0x03ff, 0x0100); + mchbar16_and_or(CLOCKGATINGIII, (u16)~0x003f, 0x0010); + mchbar16_and_or(CLOCKGATINGI, (u16)~0x7000, 0x2000);
- MCHBAR8_AND(CSHRPDCTL, ~0x0e); - MCHBAR8_AND(CSHRWRIOMLNS, ~0x0c); - MCHBAR8_AND(C0MISCCTLy(0), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(1), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(2), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(3), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(4), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(5), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(6), ~0x0e); - MCHBAR8_AND(C0MISCCTLy(7), ~0x0e); - MCHBAR8_AND(CSHRWRIOMLNS, ~0x02); + mchbar8_and(CSHRPDCTL, (u8)~0x0e); + mchbar8_and(CSHRWRIOMLNS, (u8)~0x0c); + mchbar8_and(C0MISCCTLy(0), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(1), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(2), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(3), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(4), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(5), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(6), (u8)~0x0e); + mchbar8_and(C0MISCCTLy(7), (u8)~0x0e); + mchbar8_and(CSHRWRIOMLNS, (u8)~0x02);
- MCHBAR16_AND(CSHRMISCCTL, ~0x0400); - MCHBAR16_AND(CLOCKGATINGIII, ~0x0dc0); - MCHBAR8_AND(C0WRDPYN, ~0x80); - MCHBAR32_AND(C0COREBONUS, ~(1 << 22)); - MCHBAR16_AND(CLOCKGATINGI, ~0x80fc); - MCHBAR16_AND(CLOCKGATINGII, ~0x0c00); + mchbar16_and(CSHRMISCCTL, (u16)~0x0400); + mchbar16_and(CLOCKGATINGIII, (u16)~0x0dc0); + mchbar8_and(C0WRDPYN, (u8)~0x80); + mchbar32_and(C0COREBONUS, (u32)~(1 << 22)); + mchbar16_and(CLOCKGATINGI, (u16)~0x80fc); + mchbar16_and(CLOCKGATINGII, (u16)~0x0c00);
- MCHBAR8_AND(CSHRPDCTL, ~0x0d); - MCHBAR8_AND(C0MISCCTLy(0), ~1); - MCHBAR8_AND(C0MISCCTLy(1), ~1); - MCHBAR8_AND(C0MISCCTLy(2), ~1); - MCHBAR8_AND(C0MISCCTLy(3), ~1); - MCHBAR8_AND(C0MISCCTLy(4), ~1); - MCHBAR8_AND(C0MISCCTLy(5), ~1); - MCHBAR8_AND(C0MISCCTLy(6), ~1); - MCHBAR8_AND(C0MISCCTLy(7), ~1); + mchbar8_and(CSHRPDCTL, (u8)~0x0d); + mchbar8_and(C0MISCCTLy(0), (u8)~1); + mchbar8_and(C0MISCCTLy(1), (u8)~1); + mchbar8_and(C0MISCCTLy(2), (u8)~1); + mchbar8_and(C0MISCCTLy(3), (u8)~1); + mchbar8_and(C0MISCCTLy(4), (u8)~1); + mchbar8_and(C0MISCCTLy(5), (u8)~1); + mchbar8_and(C0MISCCTLy(6), (u8)~1); + mchbar8_and(C0MISCCTLy(7), (u8)~1);
- MCHBAR32_AND_OR(C0STATRDCTRL, ~0x00700000, 3 << 20); - MCHBAR32_AND(C0COREBONUS, ~0x00100000); - MCHBAR8_OR(C0DYNSLVDLLEN, 0x1e); - MCHBAR8_OR(C0DYNSLVDLLEN2, 0x03); - MCHBAR32_AND_OR(SHCYCTRKCKEL, ~0x0c000000, 0x04000000); - MCHBAR16_OR(C0STATRDCTRL, 0x6000); - MCHBAR32_OR(C0CKECTRL, 0x00010000); - MCHBAR8_OR(C0COREBONUS, 0x10); - MCHBAR32_OR(CLOCKGATINGI - 1, 0xf << 24); - MCHBAR8_OR(CSHWRIOBONUS, 0x07); - MCHBAR8_OR(C0DYNSLVDLLEN, 0xc0); - MCHBAR8_OR(SHC2REGIII, 7); - MCHBAR16_AND_OR(SHC2MINTM, ~0xffff, 0x0080); - MCHBAR8_AND_OR(SHC2IDLETM, ~0xff, 0x10); - MCHBAR16_OR(C0COREBONUS, 0x01e0); - MCHBAR8_OR(CSHWRIOBONUS, 0x18); - MCHBAR8_OR(CSHRMSTDYNDLLENB, 0x0d); - MCHBAR16_OR(SHC3C4REG1, 0x0a3f); - MCHBAR8_OR(C0STATRDCTRL, 3); - MCHBAR8_AND_OR(C0REFRCTRL2, ~0xff, 0x4a); - MCHBAR8_AND(C0COREBONUS + 4, ~0x60); - MCHBAR16_OR(C0DYNSLVDLLEN, 0x0321); + mchbar32_and_or(C0STATRDCTRL, (u32)~0x00700000, 3 << 20); + mchbar32_and(C0COREBONUS, (u32)~0x00100000); + mchbar8_or(C0DYNSLVDLLEN, 0x1e); + mchbar8_or(C0DYNSLVDLLEN2, 0x03); + mchbar32_and_or(SHCYCTRKCKEL, (u32)~0x0c000000, 0x04000000); + mchbar16_or(C0STATRDCTRL, 0x6000); + mchbar32_or(C0CKECTRL, 0x00010000); + mchbar8_or(C0COREBONUS, 0x10); + mchbar32_or(CLOCKGATINGI - 1, 0xf << 24); + mchbar8_or(CSHWRIOBONUS, 0x07); + mchbar8_or(C0DYNSLVDLLEN, 0xc0); + mchbar8_or(SHC2REGIII, 7); + mchbar16_and_or(SHC2MINTM, (u16)~0xffff, 0x0080); + mchbar8_and_or(SHC2IDLETM, (u8)~0xff, 0x10); + mchbar16_or(C0COREBONUS, 0x01e0); + mchbar8_or(CSHWRIOBONUS, 0x18); + mchbar8_or(CSHRMSTDYNDLLENB, 0x0d); + mchbar16_or(SHC3C4REG1, 0x0a3f); + mchbar8_or(C0STATRDCTRL, 3); + mchbar8_and_or(C0REFRCTRL2, (u8)~0xff, 0x4a); + mchbar8_and(C0COREBONUS + 4, (u8)~0x60); + mchbar16_or(C0DYNSLVDLLEN, 0x0321); }
static void sdram_programdqdqs(struct sysinfo *s) @@ -2541,13 +2542,13 @@
if ((tmaxunmask >= reg32) && tmaxpi >= dqdqs_delay) { if (repeat == 2) { - MCHBAR32_AND(C0COREBONUS, ~(1 << 23)); + mchbar32_and(C0COREBONUS, (u32)~(1 << 23)); } feature = 1; repeat = 0; } else { repeat--; - MCHBAR32_OR(C0COREBONUS, 1 << 23); + mchbar32_or(C0COREBONUS, 1 << 23); cwb = 2 * mdclk; } } @@ -2556,10 +2557,10 @@ MCHBAR8(CLOCKGATINGI) = MCHBAR8(CLOCKGATINGI) & ~0x3; return; } - MCHBAR8_OR(CLOCKGATINGI, 3); - MCHBAR16_AND_OR(CLOCKGATINGIII, ~0xf000, pimdclk << 12); - MCHBAR8_AND_OR(CSHWRIOBONUSX, ~0x77, (push << 4) | push); - MCHBAR32_AND_OR(C0COREBONUS, ~0x0f000000, 0x03000000); + mchbar8_or(CLOCKGATINGI, 3); + mchbar16_and_or(CLOCKGATINGIII, (u16)~0xf000, pimdclk << 12); + mchbar8_and_or(CSHWRIOBONUSX, (u8)~0x77, (push << 4) | push); + mchbar32_and_or(C0COREBONUS, (u32)~0x0f000000, 0x03000000); }
/** @@ -2592,7 +2593,7 @@ /* Enable HPET */ enable_hpet();
- MCHBAR16_OR(CPCTL, 1 << 15); + mchbar16_or(CPCTL, 1 << 15);
sdram_clk_crossing(&si);
@@ -2627,16 +2628,16 @@ PRINTK_DEBUG("Done mmap\n");
/* Enable DDR IO buffer */ - MCHBAR8_AND_OR(C0IOBUFACTCTL, ~0x3f, 0x08); - MCHBAR8_OR(C0RSTCTL, 1); + mchbar8_and_or(C0IOBUFACTCTL, (u8)~0x3f, 0x08); + mchbar8_or(C0RSTCTL, 1);
sdram_rcompupdate(&si); PRINTK_DEBUG("Done RCOMP update\n");
- MCHBAR8_OR(HIT4, 2); + mchbar8_or(HIT4, 2);
if (si.boot_path != BOOT_PATH_RESUME) { - MCHBAR32_OR(C0CKECTRL, 1 << 27); + mchbar32_or(C0CKECTRL, 1 << 27);
sdram_jedecinit(&si); PRINTK_DEBUG("Done MRS\n"); @@ -2649,7 +2650,7 @@ PRINTK_DEBUG("Done zqcl\n");
if (si.boot_path != BOOT_PATH_RESUME) { - MCHBAR32_OR(C0REFRCTRL2, 3 << 30); + mchbar32_or(C0REFRCTRL2, 3 << 30); }
sdram_dradrb(&si); @@ -2680,7 +2681,7 @@ PRINTK_DEBUG("Done periodic RCOMP\n");
/* Set init done */ - MCHBAR32_OR(C0REFRCTRL2, 1 << 30); + mchbar32_or(C0REFRCTRL2, 1 << 30);
/* Tell ICH7 that we're done */ pci_and_config8(PCI_DEV(0, 0x1f, 0), 0xa2, (u8)~(1 << 7));
Hello Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#2).
Change subject: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() ......................................................................
nb/intel/pineview: Use new mchbar{8,16,32}_and_or()
This fix the overflow error we have with MCHBARx_AND_OR macros: "error: overflow in conversion from 'int' to 'u8' {aka 'volatile unsigned char'} changes value from '(int)*4275126567 & -256 | 64' to '64' [-Werror=overflow]"
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/pineview/Makefile.inc M src/northbridge/intel/pineview/early_init.c M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/pineview/raminit.c 6 files changed, 417 insertions(+), 344 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... File src/northbridge/intel/pineview/raminit.c:
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... PS2, Line 620: (u16) This basically tells GCC to ignore any overflows.
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... File src/northbridge/intel/pineview/raminit.c:
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... PS2, Line 620: (u16)
This basically tells GCC to ignore any overflows.
yes as "~(1 << 8)" is not an u16.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() ......................................................................
Patch Set 2:
(1 comment)
I like the introduction of the common MCHBAR accessor functions. Should we make them take a mask of bits to clear like the new pnp `unset_and_set` functions (CB:42134)?
NB. Please stop pretending that anything is fixed, if the change merely silences wrong warnings.
https://review.coreboot.org/c/coreboot/+/45517/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45517/2//COMMIT_MSG@7 PS2, Line 7: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() : : This fix the overflow error we have with MCHBARx_AND_OR macros: These two statements seem not related. Switching from macros to functions only changes where the numbers are reduced (where the overflow is noticed) but shouldn't get rid of the warnings (unless the compiler is confused). The spurious warnings are then hidden by manual casts, AFAICS.
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#3).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_and_or() functions. mchbar{8,16,32}_and() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h 2 files changed, 120 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/3
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#4).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_and_or() functions. mchbar{8,16,32}_and() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/Makefile.inc A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h 3 files changed, 124 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/4
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#5).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_and_or() functions. mchbar{8,16,32}_and() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h 2 files changed, 120 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/5
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#6).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_and() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h 2 files changed, 120 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/6
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 6:
(7 comments)
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 8: #if CONFIG(NORTHBRIDGE_INTEL_X4X) : #include <northbridge/intel/x4x/iomap.h> : #elif CONFIG(NORTHBRIDGE_INTEL_PINEVIEW) : #include <northbridge/intel/pineview/memmap.h> : #elif CONFIG(NORTHBRIDGE_INTEL_SANDYBRIDGE) : #include <northbridge/intel/sandybridge/sandybridge.h> : #elif CONFIG(NORTHBRIDGE_INTEL_IRONLAKE) : #include <northbridge/intel/ironlake/ironlake.h> : #elif CONFIG(NORTHBRIDGE_INTEL_HASWELL) : #include <northbridge/intel/haswell/memmap.h> : #endif yeah... this is something I wanted to avoid. I guess this will have to do in the meantime.
I would add an #else-block with an #error to avoid potential problems
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 20: x This is unsafe. Please add braces around the macro parameters.
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 24: int This should never be negative
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 27: void mchbar8_and(int offset, u8 value; Where did the closing brace go?
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... File src/northbridge/intel/common/mchbar_ops.c:
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 13: void mchbar8_unset_and_set(int offset, u8 unset, u8 set) Any specific reason to not make these inline? I'd recommend trying both and checking which results in a smaller binary when actually used in code.
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 40: void mchbar8_and(int offset, u8 value) For consistency, these should be `mchbarX_unset` functions (or you will have the same problem with the masks)
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 64: void mchbar8_or(int offset, u8 value) And these should be called mchbarX_set
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 6:
(7 comments)
Thx
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 8: #if CONFIG(NORTHBRIDGE_INTEL_X4X) : #include <northbridge/intel/x4x/iomap.h> : #elif CONFIG(NORTHBRIDGE_INTEL_PINEVIEW) : #include <northbridge/intel/pineview/memmap.h> : #elif CONFIG(NORTHBRIDGE_INTEL_SANDYBRIDGE) : #include <northbridge/intel/sandybridge/sandybridge.h> : #elif CONFIG(NORTHBRIDGE_INTEL_IRONLAKE) : #include <northbridge/intel/ironlake/ironlake.h> : #elif CONFIG(NORTHBRIDGE_INTEL_HASWELL) : #include <northbridge/intel/haswell/memmap.h> : #endif
yeah... this is something I wanted to avoid. I guess this will have to do in the meantime. […]
ok
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 20: x
This is unsafe. Please add braces around the macro parameters.
Done
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 24: int
This should never be negative
Done
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 27: void mchbar8_and(int offset, u8 value;
Where did the closing brace go?
here we go :)
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... File src/northbridge/intel/common/mchbar_ops.c:
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 13: void mchbar8_unset_and_set(int offset, u8 unset, u8 set)
Any specific reason to not make these inline? I'd recommend trying both and checking which results i […]
both changes the binary on lenovo/t440p with "BUILD_TIMELESS=1"
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 40: void mchbar8_and(int offset, u8 value)
For consistency, these should be `mchbarX_unset` functions (or you will have the same problem with t […]
Done
https://review.coreboot.org/c/coreboot/+/45517/6/src/northbridge/intel/commo... PS6, Line 64: void mchbar8_or(int offset, u8 value)
And these should be called mchbarX_set
Done
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#7).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.c A src/northbridge/intel/common/mchbar_ops.h 2 files changed, 122 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/7
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 8:
gives the same binary for ThinkPad T440p
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 8:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45517/2//COMMIT_MSG@7 PS2, Line 7: nb/intel/pineview: Use new mchbar{8,16,32}_and_or() : : This fix the overflow error we have with MCHBARx_AND_OR macros:
These two statements seem not related. Switching from macros to […]
Done
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... File src/northbridge/intel/pineview/raminit.c:
https://review.coreboot.org/c/coreboot/+/45517/2/src/northbridge/intel/pinev... PS2, Line 620: (u16)
yes as "~(1 << 8)" is not an u16.
Done
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#9).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
This will not change the binary for lenovo/t440p board.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/9
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 9: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45517/9//COMMIT_MSG@14 PS9, Line 14: This will not change the binary for lenovo/t440p board. This patch won't change the binary for any board, as this file doesn't even get build-tested. Jenkins happily gave it a Verified+1 on an older patchset for that reason :)
So, I don't think reproducibility is worth mentioning in this patch.
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#10).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
This will not change the binary for lenovo/t440p board.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/10
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 10:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45517/9//COMMIT_MSG@14 PS9, Line 14: This will not change the binary for lenovo/t440p board.
This patch won't change the binary for any board, as this file doesn't even get build-tested. […]
tested here : https://review.coreboot.org/c/coreboot/+/45574/5
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#11).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
This will not change the binary for lenovo/t440p board. Tested here: https://review.coreboot.org/c/coreboot/+/45574/5
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/11
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#12).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
Tested here: https://review.coreboot.org/c/coreboot/+/45574 with BUILD_TIMELESS=1, Lenovo ThinkPad T440p does not change.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/12
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#13).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/13
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 88: __always_inline void mchbar8_set(unsigned int offset, u8 set) Ugh, apologies. I just realized that the `mchbarX_set` name is very misleading:
mchbar32_set(SAPMCTL, 1UL << 31);
When I first read this, I understood the following:
set MCHBAR register `SAPMCTL` to `1UL << 31`
Which is not at all what this is doing. One could use `mchbarX_set_mask` (and update all other functions in a similar fashion), but this will make the function names rather long...
I think we could use the setbitsX/clrbitsX/clrsetbitsX macros from `src/include/device/mmio.h`, which have shorter names and provide the same `unset_and_set` semantics. What's more, we might as well just use the clrsetbitsX stuff directly:
#define __mchbar_clrsetbits_impl(bits, reg, clear, set) \ __clrsetbits_impl(bits, DEFAULT_MCHBAR + (reg), clear, set)
#define mchbar_clrsetbits8(reg, clear, set) __clrsetbits_impl(8, reg, clear, set)
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 13:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 20: #endif We can just move the MCHBAR location to Kconfig?
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 88: __always_inline void mchbar8_set(unsigned int offset, u8 set)
Ugh, apologies. I just realized that the `mchbarX_set` name is very misleading: […]
Slow down please. With macros instead of functions we'd lose the typing again. Making it impossible for the compiler to detect real overflows. We can use clrsetbitsXX() in the function bodies, ofc. (__versions are not to be used outside the file that defines them, and wouldn't be necessary.)
`clrsetbits` is against our style, IMHO. It should be `clr_set_bits`.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 88: __always_inline void mchbar8_set(unsigned int offset, u8 set)
Slow down please. With macros instead of functions we'd lose the typing […]
Very true. In that case, I'd just add the `_mask` suffix.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 20: #endif
We can just move the MCHBAR location to Kconfig?
Actually, I might as well move everything in the memmap.h files to Kconfig.
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#14).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set_mask() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 98 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/14
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#15).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set_mask() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 92 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/15
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#16).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set_mask() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/16
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#17).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set_mask() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/17
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#19).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_set_mask() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/19
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#22).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_and() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/22
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#23).
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
nb/intel/common: Introduce common MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_or() functions.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h 1 file changed, 112 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/23
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Patch Set 23:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 20: #endif
Actually, I might as well move everything in the memmap.h files to Kconfig.
Done
https://review.coreboot.org/c/coreboot/+/45517/13/src/northbridge/intel/comm... PS13, Line 88: __always_inline void mchbar8_set(unsigned int offset, u8 set)
Very true. In that case, I'd just add the `_mask` suffix.
Done
HAOUAS Elyes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Abandoned
HAOUAS Elyes has restored this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel/common: Introduce common MCHBAR accessor functions ......................................................................
Restored
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#24).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_or() functions.
Also, move common BAR's macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 144 insertions(+), 107 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/24
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#26).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_or() functions.
Also, move common BAR's macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 120 insertions(+), 107 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/26
Hello build bot (Jenkins), Nico Huber, Damien Zammit, Patrick Georgi, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#29).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds: mchbar{8,16,32}_unset_and_set() functions. mchbar{8,16,32}_unset() functions. mchbar{8,16,32}_or() functions.
Also, move common BAR's macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 120 insertions(+), 107 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/29
HAOUAS Elyes has removed Angel Pons from this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Removed reviewer Angel Pons.
HAOUAS Elyes has removed Angel Pons from this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Removed reviewer Angel Pons.
Patrick Georgi has uploaded a new patch set (#31) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 110 insertions(+), 116 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/31
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 31:
I replaced the unset_and_set things with _and_or because that's the more typical terminology around here.
Patrick Georgi has uploaded a new patch set (#32) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 112 insertions(+), 116 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/32
Patrick Georgi has uploaded a new patch set (#33) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 113 insertions(+), 117 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/33
Patrick Georgi has uploaded a new patch set (#34) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 114 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/34
Patrick Georgi has uploaded a new patch set (#35) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 114 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/35
Patrick Georgi has uploaded a new patch set (#36) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 75 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/36
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 36:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/36/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/36/src/northbridge/intel/comm... PS36, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/36/src/northbridge/intel/comm... PS36, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
Patrick Georgi has uploaded a new patch set (#37) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 75 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/37
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 37:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... PS37, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... PS37, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 37:
(1 comment)
Thanks for taking this on.
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... PS37, Line 27: (u8) Are these casts already needed to get it through Jenkins? Otherwise, we should drop them to have the compiler warn us about truncations that actually matter.
An exception is the `(u8)~0` ofc., that is truncated on purpose. But we could also just write it out, `0xff`?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 37:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... PS37, Line 8: (u8 *)DEFAULT_MCHBAR + x) Macro safety, please. Also, should we avoid pointer arithmetics?
#define MCHBAR8(x) (*((volatile u8 *)((void *)(DEFAULT_MCHBAR + (x)))))
https://review.coreboot.org/c/coreboot/+/45517/37/src/northbridge/intel/comm... PS37, Line 27: (u8)
Are these casts already needed to get it through Jenkins? Otherwise, we […]
The casts on `value` should never be needed. Casts on `mask` are probably meant to work around compilers complaining about overflow because of autopromotion when performing bitwise negations.
Also, `0xff`? Did you mean `UINT8_MAX`?
Hello build bot (Jenkins), Nico Huber, Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#38).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Patrick Georgi pgeorgi@google.com Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 81 insertions(+), 110 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/38
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 38:
(16 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/8ab70c49_47e4fcfb PS38, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/comment/52f5223d_3ce8caca PS38, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
File src/northbridge/intel/gm45/gm45.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/52a1c9f4_3180b564 PS38, Line 344: <<<<<<< HEAD spaces required around that '<' (ctx:OxW)
https://review.coreboot.org/c/coreboot/+/45517/comment/bdc55e5e_b378af98 PS38, Line 349: ======= spaces required around that '==' (ctx:ExO)
https://review.coreboot.org/c/coreboot/+/45517/comment/be179a79_585a15de PS38, Line 349: ======= spaces required around that '==' (ctx:OxO)
https://review.coreboot.org/c/coreboot/+/45517/comment/1d150902_76b77c43 PS38, Line 349: ======= spaces required around that '==' (ctx:OxO)
https://review.coreboot.org/c/coreboot/+/45517/comment/fe94d3ea_a04034a6 PS38, Line 349: ======= spaces required around that '=' (ctx:OxE)
https://review.coreboot.org/c/coreboot/+/45517/comment/62848010_5c7a8626 PS38, Line 350: >>>>>>> 7780462203 (nb/intel: Introduce MCHBAR accessor functions) spaces required around that '>' (ctx:OxW)
https://review.coreboot.org/c/coreboot/+/45517/comment/fbd17ed8_54361a17 PS38, Line 350: >>>>>>> 7780462203 (nb/intel: Introduce MCHBAR accessor functions) spaces required around that ':' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/45517/comment/ea726ff0_01c211cf PS38, Line 379: <<<<<<< HEAD spaces required around that '<' (ctx:OxW)
https://review.coreboot.org/c/coreboot/+/45517/comment/b1f2b6f4_d5e08e1b PS38, Line 384: ======= spaces required around that '==' (ctx:ExO)
https://review.coreboot.org/c/coreboot/+/45517/comment/497bf978_7a92d0a2 PS38, Line 384: ======= spaces required around that '==' (ctx:OxO)
https://review.coreboot.org/c/coreboot/+/45517/comment/a375bdc0_5f0635fb PS38, Line 384: ======= spaces required around that '==' (ctx:OxO)
https://review.coreboot.org/c/coreboot/+/45517/comment/ff68b83c_e9f12309 PS38, Line 384: ======= spaces required around that '=' (ctx:OxE)
https://review.coreboot.org/c/coreboot/+/45517/comment/25b00fee_08288ddc PS38, Line 385: >>>>>>> 7780462203 (nb/intel: Introduce MCHBAR accessor functions) spaces required around that '>' (ctx:OxW)
https://review.coreboot.org/c/coreboot/+/45517/comment/7fe56a15_c0413aa0 PS38, Line 385: >>>>>>> 7780462203 (nb/intel: Introduce MCHBAR accessor functions) spaces required around that ':' (ctx:VxW)
Attention is currently required from: HAOUAS Elyes. Hello build bot (Jenkins), Nico Huber, Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#39).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Patrick Georgi pgeorgi@google.com Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 75 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/39
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 39:
(2 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/812cab20_9eb8784b PS39, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/comment/e2c92a71_b7bbe850 PS39, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 40:
(2 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/95098963_34795d36 PS40, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/comment/400dbfde_8b2a3982 PS40, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
Hello build bot (Jenkins), Nico Huber, Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#41).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Patrick Georgi pgeorgi@google.com Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 75 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/41
Attention is currently required from: HAOUAS Elyes. build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(2 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/5ecd842d_91e9387f PS41, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/comment/5c3ab7d3_690a87ce PS41, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
Attention is currently required from: Nico Huber, Angel Pons. HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/a2378c5f_09ab492f PS37, Line 27: (u8)
The casts on `value` should never be needed. […]
Jenkins needs that mask.
Attention is currently required from: Angel Pons, HAOUAS Elyes. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/21ba1ab9_e64d239c PS37, Line 27: (u8)
Jenkins needs that mask.
What is that supposed to mean? would checkpatch complain otherwise? would the compiler complain? is it covering up bugs?
Attention is currently required from: Nico Huber, Angel Pons. HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/da386cb9_d6c5df9f PS37, Line 27: (u8)
Jenkins needs that mask. […]
Well, ~(0x01) will give 0xfffffffe and this guy is not an u8.
so, this will give an overflow as below: -------- CC romstage/northbridge/intel/x4x/raminit.o CC romstage/northbridge/intel/x4x/raminit_ddr23.o In file included from src/northbridge/intel/x4x/raminit_ddr23.c:17: src/northbridge/intel/x4x/raminit_ddr23.c: In function 'program_timings': src/northbridge/intel/x4x/x4x.h:56:52: error: overflow in conversion from 'int' to 'u8' {aka 'unsigned char'} changes value from '(int)*(volatile u8 *)((unsigned int)((int)i * 1024) + 4275126888) & -256 | 74' to '74' [-Werror=overflow] 56 | #define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or)) | ^ src/northbridge/intel/x4x/raminit_ddr23.c:626:17: note: in expansion of macro 'MCHBAR8_AND_OR' 626 | MCHBAR8_AND_OR(0x400*i + 0x268, ~0xff, 0x4a); | ^~~~~~~~~~~~~~ src/northbridge/intel/x4x/raminit_ddr23.c: In function 'prog_rcomp': src/northbridge/intel/x4x/x4x.h:57:52: error: overflow in conversion from 'int' to 'u16' {aka 'short unsigned int'} changes value from '(int)*(volatile u16 *)((unsigned int)((int)i * 1024) + 4275127072) & -65536 | 26214' to '26214' [-Werror=overflow] 57 | #define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or)) | ^ src/northbridge/intel/x4x/raminit_ddr23.c:1097:33: note: in expansion of macro 'MCHBAR16_AND_OR' 1097 | MCHBAR16_AND_OR(0x400*i + 0x320, ~0xffff, | ^~~~~~~~~~~~~~~ src/northbridge/intel/x4x/x4x.h:57:52: error: overflow in conversion from 'int' to 'u16' {aka 'short unsigned int'} changes value from '(int)*(volatile u16 *)((unsigned int)((int)i * 1024) + 4275127160) & -65536 | 52428' to '52428' [-Werror=overflow] 57 | #define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or)) | ^ src/northbridge/intel/x4x/raminit_ddr23.c:1131:33: note: in expansion of macro 'MCHBAR16_AND_OR' 1131 | MCHBAR16_AND_OR(0x378 + 0x400 * i, | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:365 : build/romstage/northbridge/intel/x4x/raminit_ddr23.o] Erreur 1
Attention is currently required from: Angel Pons, HAOUAS Elyes. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/ae0bb3d8_501d1cbc PS37, Line 27: (u8)
56 | #define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
That's about completely different code. The point to replace `and` with `mask` is to invert it later, when it already has the correct type.
Attention is currently required from: Angel Pons, HAOUAS Elyes. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/23b9eef5_b7ec8f33 PS37, Line 27: (u8)
56 | #define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or)) […]
Sorry, I mixed that up because of the changed name. It's still inverted too early.
Attention is currently required from: Angel Pons, HAOUAS Elyes. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 41:
(1 comment)
Patchset:
PS41: Looks like we first need to talk about `and_or` vs. `unset_and_set`. It's not just a different terminology, `and_or` also doesn't work well when the compiler adds more type checking.
A deferred inversion of the mask allows the compiler to check the range of the provided value (instead of the integer-promoted result of the inversion). I think this is the way to go if we want to make use of GCC 10's new features and would be happy to review anything in that direction. If the goal is to ignore GCC's new warnings, I would prefer to disable them explicitly.
I don't intend to put any more review effort into patches that introduce error-hiding casts. Feel free to add me as reviewer again if that changed.
Attention is currently required from: Angel Pons, HAOUAS Elyes. Patrick Georgi has uploaded a new patch set (#42) to the change originally created by HAOUAS Elyes. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_and(addr, mask) mchbar{8,16,32}_or(addr, value) mchbar{8,16,32}_and_or(addr, mask, value)
Also, move common BAR macros to nb/intel/common/mchbar_ops.h.
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Signed-off-by: Patrick Georgi pgeorgi@google.com --- A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h 8 files changed, 75 insertions(+), 118 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/42
Attention is currently required from: Angel Pons. build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 42:
(2 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/efdaa144_85e3153a PS42, Line 39: #define mchbar16_and_or(offset, mask, value) _mchbar16_and_or((offset), (u16)(mask), (u16)(value)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/45517/comment/76b932b7_a3cdcb05 PS42, Line 51: #define mchbar32_and_or(offset, mask, value) _mchbar32_and_or((offset), (u32)(mask), (u32)(value)) line over 96 characters
Attention is currently required from: Angel Pons. HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 42:
(2 comments)
Patchset:
PS42: Thank you
File src/northbridge/intel/gm45/gm45.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/f98cf9f5_ef1a5ac7 PS42, Line 170: #include "memmap.h" duplicated.
Attention is currently required from: Angel Pons. Hello build bot (Jenkins), Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#43).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_unset_and_set mchbar{8,16,32}__unset mchbar{8,16,32}__or
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/northbridge/intel/common/fixed_bars.h A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h M src/soc/intel/broadwell/include/soc/systemagent.h 10 files changed, 93 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/43
Attention is currently required from: Angel Pons. Hello build bot (Jenkins), Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#44).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_unset_and_set mchbar{8,16,32}_unset mchbar{8,16,32}_or
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- D src/northbridge/intel/common/fixed_bars.h A src/northbridge/intel/common/mchbar_ops.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h M src/soc/intel/broadwell/include/soc/systemagent.h 10 files changed, 96 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/44
Attention is currently required from: Angel Pons. Hello build bot (Jenkins), Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#45).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_unset_and_set mchbar{8,16,32}_unset mchbar{8,16,32}_or
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/bars_ops.h D src/northbridge/intel/common/fixed_bars.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h M src/soc/intel/broadwell/include/soc/systemagent.h 10 files changed, 96 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/45
Attention is currently required from: Angel Pons, HAOUAS Elyes. Hello build bot (Jenkins), Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#46).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_unset_and_set mchbar{8,16,32}_unset mchbar{8,16,32}_or
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/bars_ops.h D src/northbridge/intel/common/fixed_bars.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h M src/soc/intel/broadwell/include/soc/systemagent.h 10 files changed, 96 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/46
Attention is currently required from: Angel Pons, HAOUAS Elyes. Hello build bot (Jenkins), Patrick Georgi, Damien Zammit, Martin Roth, Angel Pons, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45517
to look at the new patch set (#47).
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
nb/intel: Introduce MCHBAR accessor functions
This adds functions to replace our current macros: mchbar{8,16,32}_unset_and_set mchbar{8,16,32}_unset mchbar{8,16,32}_or
Change-Id: I5fa844a8a13a75d6d802ca48f72c513bfa16d0a5 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- A src/northbridge/intel/common/bars_ops.h D src/northbridge/intel/common/fixed_bars.h M src/northbridge/intel/gm45/gm45.h M src/northbridge/intel/haswell/haswell.h M src/northbridge/intel/i945/i945.h M src/northbridge/intel/ironlake/ironlake.h M src/northbridge/intel/pineview/pineview.h M src/northbridge/intel/sandybridge/sandybridge.h M src/northbridge/intel/x4x/x4x.h M src/soc/intel/broadwell/include/soc/systemagent.h 10 files changed, 96 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/45517/47
Attention is currently required from: Nico Huber, Angel Pons. HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Patch Set 47:
(3 comments)
File src/northbridge/intel/common/mchbar_ops.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/2aebb0fe_e71ea79b PS37, Line 8: (u8 *)DEFAULT_MCHBAR + x)
Macro safety, please. Also, should we avoid pointer arithmetics? […]
Done
https://review.coreboot.org/c/coreboot/+/45517/comment/2c5eca93_c0c42136 PS37, Line 27: (u8)
Sorry, I mixed that up because of the changed name. It's still inverted […]
Ack
File src/northbridge/intel/gm45/gm45.h:
https://review.coreboot.org/c/coreboot/+/45517/comment/67d0ad62_004ce50c PS42, Line 170: #include "memmap.h"
duplicated.
Done
HAOUAS Elyes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/45517 )
Change subject: nb/intel: Introduce MCHBAR accessor functions ......................................................................
Abandoned