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

soc: brcmstb: Add Product ID and Family ID helper functions

Add Product ID and Family ID helper functions for brcmstb soc.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Al Cooper and committed by
Kishon Vijay Abraham I
7f20333f 2bd6bf03

+29
+12
drivers/soc/bcm/brcmstb/common.c
··· 40 40 return of_match_node(brcmstb_machine_match, root) != NULL; 41 41 } 42 42 43 + u32 brcmstb_get_family_id(void) 44 + { 45 + return family_id; 46 + } 47 + EXPORT_SYMBOL(brcmstb_get_family_id); 48 + 49 + u32 brcmstb_get_product_id(void) 50 + { 51 + return product_id; 52 + } 53 + EXPORT_SYMBOL(brcmstb_get_product_id); 54 + 43 55 static const struct of_device_id sun_top_ctrl_match[] = { 44 56 { .compatible = "brcm,bcm7125-sun-top-ctrl", }, 45 57 { .compatible = "brcm,bcm7346-sun-top-ctrl", },
+17
include/linux/soc/brcmstb/brcmstb.h
··· 1 1 #ifndef __BRCMSTB_SOC_H 2 2 #define __BRCMSTB_SOC_H 3 3 4 + static inline u32 BRCM_ID(u32 reg) 5 + { 6 + return reg >> 28 ? reg >> 16 : reg >> 8; 7 + } 8 + 9 + static inline u32 BRCM_REV(u32 reg) 10 + { 11 + return reg & 0xff; 12 + } 13 + 4 14 /* 5 15 * Bus Interface Unit control register setup, must happen early during boot, 6 16 * before SMP is brought up, called by machine entry point. 7 17 */ 8 18 void brcmstb_biuctrl_init(void); 19 + 20 + /* 21 + * Helper functions for getting family or product id from the 22 + * SoC driver. 23 + */ 24 + u32 brcmstb_get_family_id(void); 25 + u32 brcmstb_get_product_id(void); 9 26 10 27 #endif /* __BRCMSTB_SOC_H */