Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/platform/uv/BAU: Add UV4-specific functions

Add the UV4-specific function definitions and define an operations struct
to implement them in the BAU driver.

Many BAU MMRs, although functionally the same, have new addresses on UV4
due to hardware changes. Each MMR requires new read/write functions, but
their implementation in the driver does not change. Thus, it is enough to
enumerate them in the operations struct for the changes to take effect.

Signed-off-by: Andrew Banman <abanman@sgi.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mike Travis <travis@sgi.com>
Acked-by: Dimitri Sivanich <sivanich@sgi.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: akpm@linux-foundation.org
Cc: rja@sgi.com
Link: http://lkml.kernel.org/r/1474474161-265604-11-git-send-email-abanman@sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Andrew Banman and committed by
Ingo Molnar
4f059d51 6d78059b

+44 -1
+30
arch/x86/include/asm/uv/uv_bau.h
··· 664 664 write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_CONTROL, mmr_image); 665 665 } 666 666 667 + static inline void write_mmr_proc_payload_first(int pnode, unsigned long mmr_image) 668 + { 669 + write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_FIRST, mmr_image); 670 + } 671 + 672 + static inline void write_mmr_proc_payload_last(int pnode, unsigned long mmr_image) 673 + { 674 + write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_LAST, mmr_image); 675 + } 676 + 667 677 static inline void write_mmr_payload_first(int pnode, unsigned long mmr_image) 668 678 { 669 679 write_gmmr(pnode, UVH_LB_BAU_INTD_PAYLOAD_QUEUE_FIRST, mmr_image); ··· 717 707 static inline unsigned long read_gmmr_sw_ack(int pnode) 718 708 { 719 709 return read_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); 710 + } 711 + 712 + static inline void write_mmr_proc_sw_ack(unsigned long mr) 713 + { 714 + uv_write_local_mmr(UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); 715 + } 716 + 717 + static inline void write_gmmr_proc_sw_ack(int pnode, unsigned long mr) 718 + { 719 + write_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); 720 + } 721 + 722 + static inline unsigned long read_mmr_proc_sw_ack(void) 723 + { 724 + return read_lmmr(UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); 725 + } 726 + 727 + static inline unsigned long read_gmmr_proc_sw_ack(int pnode) 728 + { 729 + return read_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); 720 730 } 721 731 722 732 static inline void write_mmr_data_config(int pnode, unsigned long mr)
+14 -1
arch/x86/platform/uv/tlb_uv.c
··· 36 36 .write_payload_last = write_mmr_payload_last, 37 37 }; 38 38 39 + static struct bau_operations uv4_bau_ops = { 40 + .bau_gpa_to_offset = uv_gpa_to_soc_phys_ram, 41 + .read_l_sw_ack = read_mmr_proc_sw_ack, 42 + .read_g_sw_ack = read_gmmr_proc_sw_ack, 43 + .write_l_sw_ack = write_mmr_proc_sw_ack, 44 + .write_g_sw_ack = write_gmmr_proc_sw_ack, 45 + .write_payload_first = write_mmr_proc_payload_first, 46 + .write_payload_last = write_mmr_proc_payload_last, 47 + }; 48 + 49 + 39 50 /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ 40 51 static int timeout_base_ns[] = { 41 52 20, ··· 2169 2158 if (!is_uv_system()) 2170 2159 return 0; 2171 2160 2172 - if (is_uv3_hub()) 2161 + if (is_uv4_hub()) 2162 + ops = uv4_bau_ops; 2163 + else if (is_uv3_hub()) 2173 2164 ops = uv123_bau_ops; 2174 2165 else if (is_uv2_hub()) 2175 2166 ops = uv123_bau_ops;