diff --git a/bmc-kernel.dts.m4 b/bmc-kernel.dts.m4 index 08b527bfb..8ccb1abfd 100644 --- a/bmc-kernel.dts.m4 +++ b/bmc-kernel.dts.m4 @@ -24,7 +24,7 @@ define(`PIB_ODY', #address-cells = <0x2>; #size-cells = <0x1>; reg = <0x0 0x$1 0x8000>; /*dummy to fix dts warning*/ - compatible = "ibm,kernel-pib"; + compatible = "ibm,kernel-pib-ody"; index = <0x$1>; proc = <0x$2>; port = <$4>; @@ -134,7 +134,7 @@ define(`HMFSI_ODY', hmfsi-ody@$3$4 { #address-cells = <0x2>; #size-cells = <0x1>; - compatible = "ibm,kernel-fsi"; + compatible = "ibm,kernel-fsi-ody"; device-path = "/i2cr$3$4/slave@00:00/raw"; reg = <0x0 0x$1 0x8000>; /*dummy to fix dts warning*/ index = <0x$1>; diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c index c9bbed683..2e3fbc95e 100644 --- a/libpdbg/kernel.c +++ b/libpdbg/kernel.c @@ -217,6 +217,20 @@ static struct fsi kernel_fsi = { }; DECLARE_HW_UNIT(kernel_fsi); +static struct fsi kernel_fsi_ody = { + .target = { + .name = "Kernel based FSI master for oddyssey", + .compatible = "ibm,kernel-fsi-ody", + .class = "fsi-ody", + .probe = kernel_fsi_probe, + .release = kernel_fsi_release, + }, + .read = kernel_fsi_getcfam, + .write = kernel_fsi_putcfam, +}; +DECLARE_HW_UNIT(kernel_fsi_ody); + + static int kernel_pib_getscom(struct pib *pib, uint64_t addr, uint64_t *value) { int rc; @@ -263,13 +277,12 @@ static int kernel_pib_probe(struct pdbg_target *target) struct pdbg_target* get_ody_pib_target(struct pdbg_target *target) { - //TODO need to assert if the target passed is not of ocmb type uint32_t ocmb_proc = pdbg_target_index(pdbg_target_parent("proc", target)); uint32_t ocmb_index = pdbg_target_index(target) % 0x8; struct pdbg_target *pib = NULL; struct pdbg_target *pib_target; - pdbg_for_each_class_target("pib", pib_target) { + pdbg_for_each_class_target("pib-ody", pib_target) { uint32_t index = pdbg_target_index(pib_target); uint32_t proc = 0; if(!pdbg_target_u32_property(pib_target, "proc", &proc)) { @@ -286,14 +299,12 @@ struct pdbg_target* get_ody_pib_target(struct pdbg_target *target) struct pdbg_target* get_ody_fsi_target(struct pdbg_target *target) { - //TODO need to assert if the target passed is not of ocmb type uint32_t ocmb_proc = pdbg_target_index(pdbg_target_parent("proc", target)); uint32_t ocmb_index = pdbg_target_index(target) % 0x8; - printf("get_ody_fsi_target ocmb_proc %d ocmb_index %d \n", ocmb_proc, ocmb_index); struct pdbg_target *fsi = NULL; struct pdbg_target *fsi_target; - pdbg_for_each_class_target("fsi", fsi_target) { + pdbg_for_each_class_target("fsi-ody", fsi_target) { uint32_t index = pdbg_target_index(fsi_target); uint32_t proc = 0; if(!pdbg_target_u32_property(fsi_target, "proc", &proc)) { @@ -320,9 +331,24 @@ struct pib kernel_pib = { }; DECLARE_HW_UNIT(kernel_pib); +struct pib kernel_pib_ody = { + .target = { + .name = "Kernel based FSI SCOM for oddyssey", + .compatible = "ibm,kernel-pib-ody", + .class = "pib-ody", + .probe = kernel_pib_probe, + }, + .read = kernel_pib_getscom, + .write = kernel_pib_putscom, +}; +DECLARE_HW_UNIT(kernel_pib_ody); + + __attribute__((constructor)) static void register_kernel(void) { pdbg_hwunit_register(PDBG_DEFAULT_BACKEND, &kernel_fsi_hw_unit); + pdbg_hwunit_register(PDBG_DEFAULT_BACKEND, &kernel_fsi_ody_hw_unit); pdbg_hwunit_register(PDBG_DEFAULT_BACKEND, &kernel_pib_hw_unit); + pdbg_hwunit_register(PDBG_DEFAULT_BACKEND, &kernel_pib_ody_hw_unit); }