Files
Stewart Smith 49496485fe Re-license IBM written files as Apache 2.0 OR GPLv2+
SPDX makes it a simpler diff.

I have audited the commit history of each file to ensure that they are
exclusively authored by IBM and thus we have the right to relicense.

The motivation behind this is twofold:
1) We want to enable experiments with coreboot, which is GPLv2 licensed
2) An upcoming firmware component wants to incorporate code from skiboot
   and code from the Linux kernel, which is GPLv2 licensed.

I have gone through the IBM internal way of gaining approval for this.

The following files are not exclusively authored by IBM, so are *not*
included in this update (I will be seeking approval from contributors):

core/direct-controls.c
core/flash.c
core/pcie-slot.c
external/common/arch_flash_unknown.c
external/common/rules.mk
external/gard/Makefile
external/gard/rules.mk
external/opal-prd/Makefile
external/pflash/Makefile
external/xscom-utils/Makefile
hdata/vpd.c
hw/dts.c
hw/ipmi/ipmi-watchdog.c
hw/phb4.c
include/cpu.h
include/phb4.h
include/platform.h
libflash/libffs.c
libstb/mbedtls/sha512.c
libstb/mbedtls/sha512.h
platforms/astbmc/barreleye.c
platforms/astbmc/garrison.c
platforms/astbmc/mihawk.c
platforms/astbmc/nicole.c
platforms/astbmc/p8dnu.c
platforms/astbmc/p8dtu.c
platforms/astbmc/p9dsu.c
platforms/astbmc/vesnin.c
platforms/rhesus/ec/config.h
platforms/rhesus/ec/gpio.h
platforms/rhesus/gpio.c
platforms/rhesus/rhesus.c
platforms/astbmc/talos.c
platforms/astbmc/romulus.c

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
[oliver: fixed up the drift]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-03-12 20:33:18 +11:00

99 lines
2.3 KiB
C

// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
/* Copyright 2013-2019 IBM Corp. */
#ifndef __CAPP_H
#define __CAPP_H
/*
* eyecatcher PHB3: 'CAPPLIDH' in ASCII
* eyecatcher PHB4: 'CAPPLIDH' in ASCII
*/
struct capp_lid_hdr {
be64 eyecatcher;
be64 version;
be64 lid_no;
be64 pad;
be64 ucode_offset;
be64 total_size;
};
struct capp_ucode_data_hdr {
be64 eyecatcher; /* 'CAPPUCOD' in ASCII */
u8 version;
u8 reg;
u8 reserved[2];
be32 chunk_count; /* Num of 8-byte chunks that follow */
};
struct capp_ucode_data {
struct capp_ucode_data_hdr hdr;
be64 data[];
};
struct capp_ucode_lid {
be64 eyecatcher; /* 'CAPPULID' in ASCII */
be64 version;
be64 data_size; /* Total size of all capp microcode data */
u8 reserved[40];
struct capp_ucode_data data; /* This repeats */
};
enum capp_reg {
apc_master_cresp = 0x1,
apc_master_uop_table = 0x2,
snp_ttype = 0x3,
snp_uop_table = 0x4,
apt_master_capi_ctrl = 0x5,
snoop_capi_cnfg = 0x6,
canned_presp_map0 = 0x7,
canned_presp_map1 = 0x8,
canned_presp_map2 = 0x9,
flush_sue_state_map = 0xA,
apc_master_powerbus_ctrl = 0xB
};
struct capp_info {
unsigned int capp_index;
unsigned int phb_index;
uint64_t capp_fir_reg;
uint64_t capp_fir_mask_reg;
uint64_t capp_fir_action0_reg;
uint64_t capp_fir_action1_reg;
uint64_t capp_err_status_ctrl_reg;
};
struct capp_ops {
int64_t (*get_capp_info)(int, struct phb *, struct capp_info *);
};
struct capp {
struct phb *phb;
unsigned int capp_index;
uint64_t capp_xscom_offset;
uint64_t attached_pe;
uint64_t chip_id;
};
struct proc_chip;
extern struct lock capi_lock;
extern struct capp_ops capi_ops;
extern bool capp_ucode_loaded(struct proc_chip *chip, unsigned int index);
extern int64_t capp_load_ucode(unsigned int chip_id, uint32_t opal_id,
unsigned int index, u64 lid_eyecatcher,
uint32_t reg_offset,
uint64_t apc_master_addr,
uint64_t apc_master_write,
uint64_t snp_array_addr,
uint64_t snp_array_write);
extern int64_t capp_get_info(int chip_id, struct phb *phb,
struct capp_info *info);
/* Helpers to read/write capp registers */
extern int64_t capp_xscom_read(struct capp *capp, int64_t off, uint64_t *val);
extern int64_t capp_xscom_write(struct capp *capp, int64_t off, uint64_t val);
#endif /* __CAPP_H */