[Pdbg] [PATCH] main: Add P8 kernel devicetree

Alistair Popple alistair at popple.id.au
Mon Aug 13 15:17:59 AEST 2018


Joel do you know if there is someway to differentiate between P8 and P9 on
OpenBMC? This patch makes it mandatory to specify p8 vs. p9 on the command line
which feels like a step backwards. If we can't do it from the BMC then we will
have to probe it from the host.

- Alistair

On Tuesday, 7 August 2018 6:08:59 PM AEST Amitay Isaacs wrote:
> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> 
> This makes palmettos use kernel backend on bmc using coldfire driver.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  Makefile.am      |  3 ++-
>  p8-kernel.dts.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++
>  src/main.c       | 10 +++++++++-
>  3 files changed, 56 insertions(+), 2 deletions(-)
>  create mode 100644 p8-kernel.dts.m4
> 
> diff --git a/Makefile.am b/Makefile.am
> index e2783f1..2e3d67e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -14,6 +14,7 @@ EXTRA_DIST = \
>  	p8-fsi.dts.m4 \
>  	p8-host.dts.m4 \
>  	p8-i2c.dts.m4 \
> +	p8-kernel.dts.m4 \
>  	p8-pib.dts.m4 \
>  	p9-fsi.dtsi.m4 \
>  	p9-host.dts.m4 \
> @@ -26,7 +27,7 @@ EXTRA_DIST = \
>  	generate_dt_header.sh
>  
>  if TARGET_ARM
> -DT_ARM = p8-fsi.dts p8-i2c.dts \
> +DT_ARM = p8-fsi.dts p8-i2c.dts p8-kernel.dts \
>  	 p9w-fsi.dts p9r-fsi.dts p9z-fsi.dts p9-kernel.dts
>  ARCH_FLAGS="-DTARGET_ARM=1"
>  endif
> diff --git a/p8-kernel.dts.m4 b/p8-kernel.dts.m4
> new file mode 100644
> index 0000000..4a59b78
> --- /dev/null
> +++ b/p8-kernel.dts.m4
> @@ -0,0 +1,45 @@
> +/dts-v1/;
> +
> +/ {
> +       #address-cells = <0x1>;
> +       #size-cells = <0x0>;
> +
> +       fsi0: kernelfsi at 0 {
> +	       #address-cells = <0x2>;
> +	       #size-cells = <0x1>;
> +	       compatible = "ibm,kernel-fsi";
> +	       reg = <0x0 0x0 0x0>;
> +
> +	       index = <0x0>;
> +	       status = "mustexist";
> +
> +	       pib at 1000 {
> +			#address-cells = <0x2>;
> +			#size-cells = <0x1>;
> +			reg = <0x0 0x1000 0x7>;
> +			index = <0x0>;
> +			compatible = "ibm,fsi-pib", "ibm,power8-fsi-pib";
> +			include(p8-pib.dts.m4)dnl
> +	       };
> +
> +	       hmfsi at 100000 {
> +		       #address-cells = <0x2>;
> +		       #size-cells = <0x1>;
> +		       compatible = "ibm,fsi-hmfsi";
> +		       reg = <0x0 0x100000 0x8000>;
> +		       port = <0x1>;
> +		       index = <0x1>;
> +
> +		       pib at 1000 {
> +				#address-cells = <0x2>;
> +				#size-cells = <0x1>;
> +				reg = <0x0 0x1000 0x7>;
> +				compatible = "ibm,fsi-pib", "ibm,power8-fsi-pib";
> +				index = <0x1>;
> +				include(p8-pib.dts.m4)dnl
> +		       };
> +
> +	       };
> +       };
> +};
> +
> diff --git a/src/main.c b/src/main.c
> index fcdab67..2330007 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -46,6 +46,7 @@
>  #ifdef TARGET_ARM
>  #include "p8-i2c.dt.h"
>  #include "p8-fsi.dt.h"
> +#include "p8-kernel.dt.h"
>  #include "p9w-fsi.dt.h"
>  #include "p9r-fsi.dt.h"
>  #include "p9z-fsi.dt.h"
> @@ -619,7 +620,14 @@ static int target_selection(void)
>  		break;
>  
>  	case KERNEL:
> -		pdbg_targets_init(&_binary_p9_kernel_dtb_o_start);
> +		if (device_node == NULL) {
> +			PR_ERROR("kernel backend requires a device type\n");
> +			return -1;
> +		}
> +		if (!strcmp(device_node, "p8"))
> +			pdbg_targets_init(&_binary_p8_kernel_dtb_o_start);
> +		else
> +			pdbg_targets_init(&_binary_p9_kernel_dtb_o_start);
>  		break;
>  
>  #endif
> 




More information about the Pdbg mailing list