mc_amd.h (8a40a695) | mc_amd.h (4156fc34) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 20 unchanged lines hidden (view full) --- 29 30#include <sys/mc.h> 31#include <sys/x86_archext.h> 32 33/* 34 * The mc-amd driver exports an nvlist to userland, where the primary 35 * consumer is the "chip" topology enumerator for this platform type which 36 * builds a full topology subtree from this information. Others can use | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 20 unchanged lines hidden (view full) --- 29 30#include <sys/mc.h> 31#include <sys/x86_archext.h> 32 33/* 34 * The mc-amd driver exports an nvlist to userland, where the primary 35 * consumer is the "chip" topology enumerator for this platform type which 36 * builds a full topology subtree from this information. Others can use |
37 * it, too, but don't depend on it not changing without an ARC contract. | 37 * it, too, but don't depend on it not changing without an ARC contract 38 * (and the contract should probably concern the topology, not this nvlist). |
38 * 39 * In the initial mc-amd implementation this nvlist was not versioned; 40 * we'll think of that as version 0 and it may be recognised by the absence 41 * of a "mcamd-nvlist-version member. 42 * 43 * Version 1 is defined as follows. A name in square brackets indicates 44 * that member is optional (only present if the actual value is valid). 45 * --- 262 unchanged lines hidden (view full) --- 308 uint32_t reserved1:2; /* 4:3 */ 309 uint32_t BaseAddrLo:9; /* 13:5 - Base Addr 21:13 */ 310 uint32_t reserved2:5; /* 18:14 */ 311 uint32_t BaseAddrHi:10; /* 28:19 - Base Addr 36:27 */ 312 uint32_t reserved3:3; /* 31:39 */ 313 } _fmt_revFG; 314}; 315 | 39 * 40 * In the initial mc-amd implementation this nvlist was not versioned; 41 * we'll think of that as version 0 and it may be recognised by the absence 42 * of a "mcamd-nvlist-version member. 43 * 44 * Version 1 is defined as follows. A name in square brackets indicates 45 * that member is optional (only present if the actual value is valid). 46 * --- 262 unchanged lines hidden (view full) --- 309 uint32_t reserved1:2; /* 4:3 */ 310 uint32_t BaseAddrLo:9; /* 13:5 - Base Addr 21:13 */ 311 uint32_t reserved2:5; /* 18:14 */ 312 uint32_t BaseAddrHi:10; /* 28:19 - Base Addr 36:27 */ 313 uint32_t reserved3:3; /* 31:39 */ 314 } _fmt_revFG; 315}; 316 |
316#define MC_CSBASE(up, rev) (MC_REV_MATCH(rev, MC_REV_F) ? \ | 317#define MC_CSBASE(up, rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? \ |
317 (uint64_t)MCREG_FIELD_revFG(up, BaseAddrHi) << 27 | \ 318 (uint64_t)MCREG_FIELD_revFG(up, BaseAddrLo) << 13 : \ 319 (uint64_t)MCREG_FIELD_preF(up, BaseAddrHi) << 25 | \ 320 (uint64_t)MCREG_FIELD_preF(up, BaseAddrLo) << 13) 321 322/* 323 * Function 2 - DRAM Controller: DRAM CS Mask Registers 324 */ --- 17 unchanged lines hidden (view full) --- 342 uint32_t reserved1:5; /* 4:0 */ 343 uint32_t AddrMaskLo:9; /* 13:5 - Addr Mask 21:13 */ 344 uint32_t reserved2:5; /* 18:14 */ 345 uint32_t AddrMaskHi:10; /* 28:19 - Addr Mask 36:27 */ 346 uint32_t reserved3:3; /* 31:29 */ 347 } _fmt_revFG; 348}; 349 | 318 (uint64_t)MCREG_FIELD_revFG(up, BaseAddrHi) << 27 | \ 319 (uint64_t)MCREG_FIELD_revFG(up, BaseAddrLo) << 13 : \ 320 (uint64_t)MCREG_FIELD_preF(up, BaseAddrHi) << 25 | \ 321 (uint64_t)MCREG_FIELD_preF(up, BaseAddrLo) << 13) 322 323/* 324 * Function 2 - DRAM Controller: DRAM CS Mask Registers 325 */ --- 17 unchanged lines hidden (view full) --- 343 uint32_t reserved1:5; /* 4:0 */ 344 uint32_t AddrMaskLo:9; /* 13:5 - Addr Mask 21:13 */ 345 uint32_t reserved2:5; /* 18:14 */ 346 uint32_t AddrMaskHi:10; /* 28:19 - Addr Mask 36:27 */ 347 uint32_t reserved3:3; /* 31:29 */ 348 } _fmt_revFG; 349}; 350 |
350#define MC_CSMASKLO_LOBIT(rev) (MC_REV_MATCH(rev, MC_REV_F) ? 13 : 13) 351#define MC_CSMASKLO_HIBIT(rev) (MC_REV_MATCH(rev, MC_REV_F) ? 21 : 19) | 351#define MC_CSMASKLO_LOBIT(rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? 13 : 13) 352#define MC_CSMASKLO_HIBIT(rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? 21 : 19) |
352 | 353 |
353#define MC_CSMASKHI_LOBIT(rev) (MC_REV_MATCH(rev, MC_REV_F) ? 27 : 25) 354#define MC_CSMASKHI_HIBIT(rev) (MC_REV_MATCH(rev, MC_REV_F) ? 36 : 33) | 354#define MC_CSMASKHI_LOBIT(rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? 27 : 25) 355#define MC_CSMASKHI_HIBIT(rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? 36 : 33) |
355 | 356 |
356#define MC_CSMASK_UNMASKABLE(rev) (MC_REV_MATCH(rev, MC_REV_F) ? 0 : 2) | 357#define MC_CSMASK_UNMASKABLE(rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? 0 : 2) |
357 | 358 |
358#define MC_CSMASK(up, rev) (MC_REV_MATCH(rev, MC_REV_F) ? \ | 359#define MC_CSMASK(up, rev) (MC_REV_MATCH(rev, MC_REVS_FG) ? \ |
359 (uint64_t)MCREG_FIELD_revFG(up, AddrMaskHi) << 27 | \ 360 (uint64_t)MCREG_FIELD_revFG(up, AddrMaskLo) << 13 | 0x7c01fff : \ 361 (uint64_t)MCREG_FIELD_preF(up, AddrMaskHi) << 25 | \ 362 (uint64_t)MCREG_FIELD_preF(up, AddrMaskLo) << 13 | 0x1f01fff) 363 364/* 365 * Function 2 - DRAM Controller: DRAM Bank Address Mapping Registers 366 */ --- 291 unchanged lines hidden --- | 360 (uint64_t)MCREG_FIELD_revFG(up, AddrMaskHi) << 27 | \ 361 (uint64_t)MCREG_FIELD_revFG(up, AddrMaskLo) << 13 | 0x7c01fff : \ 362 (uint64_t)MCREG_FIELD_preF(up, AddrMaskHi) << 25 | \ 363 (uint64_t)MCREG_FIELD_preF(up, AddrMaskLo) << 13 | 0x1f01fff) 364 365/* 366 * Function 2 - DRAM Controller: DRAM Bank Address Mapping Registers 367 */ --- 291 unchanged lines hidden --- |