Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ libpdbg_la_SOURCES = \
libpdbg/p9_fapi_targets.c \
libpdbg/p9_scom_addr.h \
libpdbg/p10chip.c \
libpdbg/p12chip.c \
libpdbg/p10_fapi_targets.c \
libpdbg/p10_scom_addr.h \
libpdbg/p12_fapi_targets.c \
libpdbg/p12_scom_addr.h \
libpdbg/hubchip.c \
libpdbg/computechip.c \
libpdbg/sbefifo.c \
libpdbg/sbe_api.c \
libpdbg/sprs.h \
Expand Down Expand Up @@ -321,6 +326,7 @@ RAGEL_V_0 = @echo " RAGEL " $@;

%.dts: %.dts.m4
$(M4_V)$(M4) -I$(dir $<) $< | $(DTC) -I dts -O dts > $@
cp $@ $(srcdir)

%.dtsi: %.dtsi.m4
$(M4_V)$(M4) -I$(dir $<) $< > $@
Expand Down
106 changes: 94 additions & 12 deletions bmc-kernel-rainier.dts.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,27 @@ define(`PIB',
compatible = "ibm,kernel-pib";
index = <0x$2>;
device-path = "/dev/scom$3";
system-path = "/proc$2/pib";

system-path = "/backplane0/proc_module0/hub_chip$2/pib";
};
')dnl

dnl
dnl COMPUTE_CHIP_PIB([addr], [index], [path-index])
dnl
define(`COMPUTE_CHIP_PIB',
`
compute_chip_pib@$1 {
#address-cells = <0x2>;
#size-cells = <0x1>;
reg = <0x0 0x$1 0x7>;
compatible = "ibm,kernel-pib";
index = <0x1$2>;
device-path = "/dev/scom$3";

system-path = "/backplane0/proc_module0/compute_chip$2/pib";
};
')dnl

dnl
dnl PIB_ODY([index], [proc], [path-index], port)
Expand Down Expand Up @@ -45,21 +62,27 @@ define(`SBEFIFO',
index = <0x$1>;
device-path = "/dev/sbefifo$2";

sbefifo-mem {
compatible = "ibm,sbefifo-mem";
sbefifo-chipop {
compatible = "ibm,sbefifo-chipop";
index = <0x$1>;
system-path = "/mem$1";
};
};
')dnl

sbefifo-pba {
compatible = "ibm,sbefifo-mem-pba";
index = <0x$1>;
system-path = "/mempba$1";
};
dnl
dnl COMPUTE_CHIP_SBEFIFO([index], [path-index])
dnl
define(`COMPUTE_CHIP_SBEFIFO',
`
compute_chip_sbefifo@2400 { /* Bogus address */
reg = <0x0 0x2400 0x7>;
compatible = "ibm,kernel-sbefifo";
index = <0x1$1>;
device-path = "/dev/sbefifo$2";

sbefifo-chipop {
compatible = "ibm,sbefifo-chipop";
index = <0x$1>;
index = <0x1$1>;
};
};
')dnl
Expand All @@ -76,7 +99,7 @@ define(`FSI_PRE',
compatible = "ibm,kernel-fsi";
device-path = "/fsi0/slave@00:00/raw";
index = <0x$2>;
system-path = "/proc$2/fsi";
system-path = "/backplane0/proc_module0/hub_chip$2/fsi";
status = "mustexist";

PIB(1000, $2, $3)
Expand All @@ -91,6 +114,33 @@ define(`FSI_POST',
};
')dnl

dnl
dnl COMPUTE_CHIP_FSI_PRE([addr], [index], [path-index])
dnl
define(`COMPUTE_CHIP_FSI_PRE',
`
compute_chip_fsi@$1 {
#address-cells = <0x2>;
#size-cells = <0x1>;
reg = <0x0 0x$1 0x8000>;
compatible = "ibm,kernel-fsi";
device-path = "/fsi0/slave@00:00/raw";
index = <0x$2>;
system-path = "/backplane0/proc_module0/compute_chip$2/fsi";
status = "mustexist";

COMPUTE_CHIP_PIB(1000, $2, $3)
COMPUTE_CHIP_SBEFIFO($2, $3)
')dnl

dnl
dnl COMPUTE_CHIP_FSI_POST()
dnl
define(`COMPUTE_CHIP_FSI_POST',
`
};
')dnl

dnl
dnl BMC_I2CBUS([index])
dnl
Expand Down Expand Up @@ -119,13 +169,33 @@ define(`HMFSI',
compatible = "ibm,fsi-hmfsi";
port = <0x$2>;
index = <0x$3>;
system-path = "/proc$3/fsi";
system-path = "/backplane0/proc_module0/hub_chip$3/fsi";

PIB(1000, $3, $4)
SBEFIFO($3, $4)
};
')dnl


dnl
dnl COMPUTE_CHIP_HMFSI([addr], [port], [index], [path-index])
dnl
define(`COMPUTE_CHIP_HMFSI',
`
compute_chip_hmfsi@$1 {
#address-cells = <0x2>;
#size-cells = <0x1>;
reg = <0x0 0x$1 0x8000>;
compatible = "ibm,fsi-hmfsi";
port = <0x$2>;
index = <0x$3>;
system-path = "/backplane0/proc_module0/hub_chip$3/fsi";

COMPUTE_CHIP_PIB(1000, $3, $4)
COMPUTE_CHIP_SBEFIFO($3, $4)
};
')dnl

//ody ocmb chips are defined in system device tree. The pdbg targets
//that captures the device path to communicate with system ody ocmb
//chips will be defined in backend device tree.
Expand Down Expand Up @@ -194,6 +264,18 @@ define(`HMFSI_ODY',

FSI_POST()

COMPUTE_CHIP_FSI_PRE(0, 0, 1)

COMPUTE_CHIP_HMFSI(100000, 1, 1, 2)
COMPUTE_CHIP_HMFSI(180000, 2, 2, 3)
COMPUTE_CHIP_HMFSI(200000, 3, 3, 4)
COMPUTE_CHIP_HMFSI(280000, 4, 4, 5)
COMPUTE_CHIP_HMFSI(300000, 5, 5, 6)
COMPUTE_CHIP_HMFSI(380000, 6, 6, 7)
COMPUTE_CHIP_HMFSI(400000, 7, 7, 8)

COMPUTE_CHIP_FSI_POST()

HMFSI_ODY(0, 0, 1, 11)
HMFSI_ODY(1, 0, 1, 10)
HMFSI_ODY(2, 0, 1, 12)
Expand Down
107 changes: 90 additions & 17 deletions bmc-sbefifo-rainier.dts.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@ define(`SBEFIFO',
#size-cells = <0x1>;
compatible = "ibm,sbefifo-pib";
index = <0x$1>;
system-path = "/proc$1/pib";
};

sbefifo-mem {
compatible = "ibm,sbefifo-mem";
index = <0x$1>;
system-path = "/mem$1";
};

sbefifo-pba {
compatible = "ibm,sbefifo-mem-pba";
index = <0x$1>;
system-path = "/mempba$1";
system-path = "/backplane0/proc_module0/hub_chip$1/pib";
};

sbefifo-chipop {
Expand All @@ -49,8 +37,8 @@ define(`FSI_PRE',
reg = <0x0 0x$1 0x8000>;
index = <0x$2>;
status = "mustexist";
system-path = "/proc$2/fsi";

system-path = "/backplane0/proc_module0/hub_chip$2/fsi";
SBEFIFO($2, $3)
')dnl

Expand All @@ -75,12 +63,85 @@ define(`HMFSI',
reg = <0x0 0x$1 0x8000>;
port = <0x$2>;
index = <0x$3>;
system-path = "/proc$3/fsi";

system-path = "/backplane0/proc_module0/hub_chip$3/fsi";
SBEFIFO($3, $4)
};
')dnl



dnl
dnl COMPUTE_CHIP_SBEFIFO([index], [path-index])
dnl
define(`COMPUTE_CHIP_SBEFIFO',
`
computechip_sbefifo@2400 { /* Bogus address */
reg = <0x0 0x2400 0x7>;
compatible = "ibm,kernel-sbefifo";
index = <0x1$1>;
device-path = "/dev/sbefifo$2";

computechip_sbefifo-pib {
#address-cells = <0x2>;
#size-cells = <0x1>;
compatible = "ibm,sbefifo-pib";
index = <0x1$1>;
system-path = "/backplane0/proc_module0/compute_chip$1/pib";
};

computechip_sbefifo-chipop {
compatible = "ibm,sbefifo-chipop";
index = <0x1$1>;
};
};
')dnl

dnl
dnl COMPUTE_CHIP_FSI_PRE([addr], [index], [path-index])
dnl
define(`COMPUTE_CHIP_FSI_PRE',
`
computechip_fsi@$1 {
#address-cells = <0x2>;
#size-cells = <0x1>;
compatible = "ibm,kernel-fsi";
device-path = "/fsi0/slave@00:00/raw";
reg = <0x0 0x$1 0x8000>;
index = <0x$2>;
status = "mustexist";
system-path = "/backplane0/proc_module0/compute_chip$2/fsi";

COMPUTE_CHIP_SBEFIFO($2, $3)
')dnl

dnl
dnl COMPUTE_CHIP_FSI_POST()
dnl
define(`COMPUTE_CHIP_FSI_POST',
`
};
')dnl

dnl
dnl COMPUTE_CHIP_HMFSI([addr], [port], [index], [path-index])
dnl
define(`COMPUTE_CHIP_HMFSI',
`
computechip_hmfsi@$1 {
#address-cells = <0x2>;
#size-cells = <0x1>;
compatible = "ibm,kernel-fsi";
device-path = "/fsi1/slave@0$2:00/raw";
reg = <0x0 0x$1 0x8000>;
port = <0x$2>;
index = <0x$3>;
system-path = "/backplane0/proc_module0/compute_chip$3/fsi";

COMPUTE_CHIP_SBEFIFO($3, $4)
};
')dnl

//ocmb ody ddr5 chip SBE instance will be mapped to /dev/sbefifoXYY
//device path where X is proc and YY is port. BMC need to use this
//path for get/put scom to SBE instance of the ocmb ddr5 chip.
Expand Down Expand Up @@ -186,6 +247,18 @@ define(`BMC_I2CBUS',

FSI_POST()

COMPUTE_CHIP_FSI_PRE(0, 0, 1)

COMPUTE_CHIP_HMFSI(100000, 1, 1, 2)
COMPUTE_CHIP_HMFSI(180000, 2, 2, 3)
COMPUTE_CHIP_HMFSI(200000, 3, 3, 4)
COMPUTE_CHIP_HMFSI(280000, 4, 4, 5)
COMPUTE_CHIP_HMFSI(300000, 5, 5, 6)
COMPUTE_CHIP_HMFSI(380000, 6, 6, 7)
COMPUTE_CHIP_HMFSI(400000, 7, 7, 8)

COMPUTE_CHIP_FSI_POST()

HMFSI_ODY(0, 0, 1, 11)
HMFSI_ODY(1, 0, 1, 10)
HMFSI_ODY(2, 0, 1, 12)
Expand Down
43 changes: 43 additions & 0 deletions libpdbg/computechip.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright 2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <stdlib.h>
#include <ccan/array_size/array_size.h>
#include <unistd.h>

#include "hwunit.h"
#include "operations.h"
#include "bitutils.h"
#include "debug.h"


static struct computechip computechip = {
.target = {
.name = "Compute Chip",
.compatible = "ibm,power12-computechip",
.class = "computechip",
},
};
DECLARE_HW_UNIT(computechip);

__attribute__((constructor))
static void register_computechip(void)
{
pdbg_hwunit_register(PDBG_DEFAULT_BACKEND, &computechip_hw_unit);
}
Loading
Loading