2 <:copyright-BRCM:2019:DUAL/GPL:standard
4 Copyright (c) 2019 Broadcom
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License, version 2, as published by
9 the Free Software Foundation (the "GPL").
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
17 A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by
18 writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.
24 /*****************************************************************************
26 * This contains special header for different flavors of PMC drivers.
27 *****************************************************************************/
29 #ifndef PMC_DRV_SPECIAL_H__
30 #define PMC_DRV_SPECIAL_H__
32 #if defined(__KERNEL__) || defined(_ATF_)
36 #include "bcm_map_part.h"
37 #include "bcm_mem_reserve.h"
40 #define IS_BCMCHIP(num) (defined(_BCM9##num##_) || \
41 defined(CONFIG_BCM9##num) || defined(CONFIG_BCM##num))
45 #include "pmc_addr_63138.h"
46 #elif IS_BCMCHIP(63148)
47 #include "pmc_addr_63148.h"
48 #elif IS_BCMCHIP(6858)
49 #include "pmc_addr_6858.h"
50 #elif IS_BCMCHIP(6846)
51 #include "pmc_addr_6846.h"
52 #elif IS_BCMCHIP(6878)
53 #include "pmc_addr_6878.h"
54 #elif IS_BCMCHIP(4908)
55 #include "pmc_addr_4908.h"
56 #elif IS_BCMCHIP(63158)
57 #include "pmc_addr_63158.h"
58 #elif IS_BCMCHIP(63178)
59 #include "pmc_addr_63178.h"
60 #elif IS_BCMCHIP(47622)
61 #include "pmc_addr_47622.h"
62 #elif IS_BCMCHIP(6856)
63 #include "pmc_addr_6856.h"
64 #elif IS_BCMCHIP(63146)
65 #include "pmc_addr_63146.h"
66 #elif IS_BCMCHIP(4912)
67 #include "pmc_addr_4912.h"
68 #elif IS_BCMCHIP(6855)
69 #include "pmc_addr_6855.h"
70 #elif IS_BCMCHIP(6756)
71 #include "pmc_addr_6756.h"
75 #if defined(_CFE_) && !defined(_ATF_)
76 #include "lib_printf.h"
77 #include "lib_types.h"
78 #include "lib_string.h"
80 #include "bsp_config.h"
81 #include "bcm63xx_util.h"
82 #include "shared_utils.h"
84 #define MAX_PMC_ROM_SIZE 0x8000
85 #define MAX_PMC_LOG_SIZE 0x8000
87 #if defined(_BCM963158_) && !defined(CONFIG_BRCM_IKOS)
88 #define PMC_SHARED_MEMORY 0x80204000
90 #if MAX_PMC_ROM_SIZE + MAX_PMC_LOG_SIZE > CFG_BOOT_PMC_SIZE
91 #error ROM and LOG buffer size needs to be re-adjusted
93 #endif /* _BCM963158_ */
95 extern void _cfe_flushcache(int, uint8_t *, uint8_t *);
96 extern int getAVSConfig(void);
97 #define is_pmcfw_code_loaded(void) (0)
98 #define is_pmcfw_data_loaded(void) (0)
102 #include <linux/module.h>
103 #include <linux/delay.h>
104 void pmc_spin_lock(void);
105 void pmc_spin_unlock(void);
106 #if defined(CONFIG_BCM96878) || defined(CONFIG_BCM96855)
107 void keyhole_spin_lock(void);
108 void keyhole_spin_unlock(void);
110 #else // #ifdef __KERNEL__
111 #ifndef EXPORT_SYMBOL
112 #define EXPORT_SYMBOL(a)
114 #define pmc_spin_lock(...) do { } while (0)
115 #define pmc_spin_unlock(...) do { } while (0)
116 #if defined(CONFIG_BCM96878) || defined(CONFIG_BCM96855)
117 #define keyhole_spin_lock(...) do { } while (0)
118 #define keyhole_spin_unlock(...) do { } while (0)
120 #define printk printf
123 #define phys_to_virt(a) (a)
125 #endif // #ifdef __KERNEL__
126 #endif // #ifndef __ASSEMBLER__
128 #endif // #ifndef PMC_DRV_SPECIAL_H__