Skip to content

Commit

Permalink
x86/platform/uv: Update UV MMRs for UV5
Browse files Browse the repository at this point in the history
Update UV MMRs in uv_mmrs.h for UV5 based on Verilog output from the
UV Hub hardware design files.  This is the next UV architecture with
a new class (UVY) being defined for 52 bit physical address masks.
Uses a bitmask for UV arch identification so a single test can cover
multiple versions.  Includes other adjustments to match the uv_mmrs.h
file to keep from encountering compile errors.  New UV5 functionality
is added in the patches that follow.

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
  • Loading branch information
mike-travis authored and intel-lab-lkp committed Oct 2, 2020
1 parent bcdf9c6 commit ee300e6
Show file tree
Hide file tree
Showing 5 changed files with 4,277 additions and 3,701 deletions.
61 changes: 32 additions & 29 deletions arch/x86/include/asm/uv/uv_hub.h
Expand Up @@ -144,6 +144,8 @@ struct uv_gam_range_s {
* available in the L3 cache on the cpu socket for the node.
*/
struct uv_hub_info_s {
unsigned int hub_type;
unsigned char hub_revision;
unsigned long global_mmr_base;
unsigned long global_mmr_shift;
unsigned long gpa_mask;
Expand All @@ -156,7 +158,6 @@ struct uv_hub_info_s {
unsigned char m_val;
unsigned char n_val;
unsigned char gr_table_len;
unsigned char hub_revision;
unsigned char apic_pnode_shift;
unsigned char gpa_shift;
unsigned char m_shift;
Expand Down Expand Up @@ -205,6 +206,17 @@ static inline struct uv_hub_info_s *uv_cpu_hub_info(int cpu)
return (struct uv_hub_info_s *)uv_cpu_info_per(cpu)->p_uv_hub_info;
}

static inline int uv_hub_type(void)
{
return uv_hub_info->hub_type;
}

static inline __init void uv_hub_type_set(int uvmask)
{
uv_hub_info->hub_type = uvmask;
}


/*
* HUB revision ranges for each UV HUB architecture.
* This is a software convention - NOT the hardware revision numbers in
Expand All @@ -215,38 +227,29 @@ static inline struct uv_hub_info_s *uv_cpu_hub_info(int cpu)
#define UV4_HUB_REVISION_BASE 7
#define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */

static inline int is_uv2_hub(void)
{
return is_uv_hubbed(uv(2));
}

static inline int is_uv3_hub(void)
{
return is_uv_hubbed(uv(3));
}
static inline int is_uv(int uvmask) { return uv_hub_type() & uvmask; }
static inline int is_uv1_hub(void) { return 0; }
static inline int is_uv2_hub(void) { return is_uv(UV2); }
static inline int is_uv3_hub(void) { return is_uv(UV3); }
static inline int is_uv4a_hub(void) { return is_uv(UV4A); }
static inline int is_uv4_hub(void) { return is_uv(UV4); }
static inline int is_uv5_hub(void) { return 0; }

/* First test "is UV4A", then "is UV4" */
static inline int is_uv4a_hub(void)
{
if (is_uv_hubbed(uv(4)))
return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE);
return 0;
}
/*
* UV4A is a revision of UV4. So on UV4A, both is_uv4_hub() and
* is_uv4a_hub() return true, While on UV4, only is_uv4_hub()
* returns true. So to get true results, first test if is UV4A,
* then test if is UV4.
*/

static inline int is_uv4_hub(void)
{
return is_uv_hubbed(uv(4));
}
/* UVX class: UV2,3,4 */
static inline int is_uvx_hub(void) { return is_uv(UVX); }

static inline int is_uvx_hub(void)
{
return (is_uv_hubbed(-2) >= uv(2));
}
/* UVY class: UV5,..? */
static inline int is_uvy_hub(void) { return 0; }

static inline int is_uv_hub(void)
{
return is_uvx_hub();
}
/* Any UV Hubbed System */
static inline int is_uv_hub(void) { return is_uv(UV_ANY); }

union uvh_apicid {
unsigned long v;
Expand Down

0 comments on commit ee300e6

Please sign in to comment.