Skip to content

Commit

Permalink
cater for moving ocmb out of proc in device tree
Browse files Browse the repository at this point in the history
1) As present ocmb is added under proc chip even though ocmb
is a chip itself.

2) Moved ocmb out of proc chip as it needs to use its own
pib and iic bus

3) cater for moving ocmb out of proc chip in device tree

4) Ensured that ddr4 ocmb targets still use proc pib, fsi bus

Tested:
i------------kernel pib read-----------
PDBG:Translating target addr 0x50001 -> 0x50001 on /proc0/ocmb2
PDBG:pib_read_helper[158]: rc = 0, addr = 0x0000000000050001, data = 0x80c0000200000000, target = /proc0/ocmb2
ody kernel pib read address 0x50001 orig value 0x80c0000200000000 rc =0

-----ocmb ddr5 getscom --------------
get_backend_target FOUND  classs sbefifo-ody index = 0x2 ocmb index = 0x2
odyssesy chip ocmb_getscom  ocmb index=2 addr= c0002040 orig value 0x4001000a000640 ret 0

-------------cfam-------------------------------
PDBG:Translating target addr 0x2804 -> 0x2804 on /hmfsi-ody@810
PDBG:Failed to read from 0x00002810 (0000000000002804)
PDBG:fsi_read_helper[314]: rc = 6, addr = 0x02804, data = 0x10000010, target = /hmfsi-ody@810

--------------dump & ffdc-----------------------
sucessfully collected dump data len is 20184
sbefifo_op_ody_ffdc_get calling fsi_ody_read
PDBG:Translating target addr 0x2809 -> 0x2809 on /hmfsi-ody@110
PDBG:fsi_read_helper[312]: rc = 0, addr = 0x02809, data = 0x9133603f, target = /hmfsi-ody@110

DDR4 system validation
1) IPLed the system and ensured it reached runtime

Tested hardeare dump
Jan 28 06:04:20 ever6bmc phosphor-dump-manager[12876]: getDump callig sbe_dump
Jan 28 06:04:33 ever6bmc phosphor-dump-manager[12876]: dataLen received is 0x00004ED8 /n
Jan 28 06:04:33 ever6bmc phosphor-dump-manager[12877]: PDBG Initilization started

Signed-off-by: Marri Devender Rao <[email protected]>
Change-Id: Icf9bbee5f5f47659ae005777d21bd8c8bc60ea39
  • Loading branch information
devenrao committed Jan 28, 2024
1 parent fae88a6 commit 664173c
Show file tree
Hide file tree
Showing 10 changed files with 374 additions and 560 deletions.
127 changes: 64 additions & 63 deletions bmc-kernel.dts.m4
Original file line number Diff line number Diff line change
Expand Up @@ -203,67 +203,68 @@ define(`HMFSI_ODY',
HMFSI_ODY(6, 0, 1, 14)
HMFSI_ODY(7, 0, 1, 15)

HMFSI_ODY(0, 1, 2, 02)
HMFSI_ODY(1, 1, 2, 03)
HMFSI_ODY(2, 1, 2, 10)
HMFSI_ODY(3, 1, 2, 11)
HMFSI_ODY(4, 1, 2, 14)
HMFSI_ODY(5, 1, 2, 15)
HMFSI_ODY(6, 1, 2, 16)
HMFSI_ODY(7, 1, 2, 17)


HMFSI_ODY(0, 2, 3, 00)
HMFSI_ODY(1, 2, 3, 01)
HMFSI_ODY(2, 2, 3, 10)
HMFSI_ODY(3, 2, 3, 11)
HMFSI_ODY(4, 2, 3, 12)
HMFSI_ODY(5, 2, 3, 13)
HMFSI_ODY(6, 2, 3, 14)
HMFSI_ODY(7, 2, 3, 15)

HMFSI_ODY(0, 3, 4, 02)
HMFSI_ODY(1, 3, 4, 03)
HMFSI_ODY(2, 3, 4, 10)
HMFSI_ODY(3, 3, 4, 11)
HMFSI_ODY(4, 3, 4, 14)
HMFSI_ODY(5, 3, 4, 15)
HMFSI_ODY(6, 3, 4, 16)
HMFSI_ODY(7, 3, 4, 17)

HMFSI_ODY(0, 4, 5, 00)
HMFSI_ODY(1, 4, 5, 01)
HMFSI_ODY(2, 4, 5, 10)
HMFSI_ODY(3, 4, 5, 11)
HMFSI_ODY(4, 4, 5, 12)
HMFSI_ODY(5, 4, 5, 13)
HMFSI_ODY(6, 4, 5, 14)
HMFSI_ODY(7, 4, 5, 15)

HMFSI_ODY(0, 5, 6, 02)
HMFSI_ODY(1, 5, 6, 03)
HMFSI_ODY(2, 5, 6, 10)
HMFSI_ODY(3, 5, 6, 11)
HMFSI_ODY(4, 5, 6, 14)
HMFSI_ODY(5, 5, 6, 15)
HMFSI_ODY(6, 5, 6, 16)
HMFSI_ODY(7, 5, 6, 17)

HMFSI_ODY(0, 6,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
HMFSI_ODY(27, 4, 5, 15)

HMFSI_ODY(28, 5, 6, 02)
HMFSI_ODY(29, 5, 6, 03)
HMFSI_ODY(2a, 5, 6, 10)
HMFSI_ODY(2b, 5, 6, 11)
HMFSI_ODY(2c, 5, 6, 14)
HMFSI_ODY(2d, 5, 6, 15)
HMFSI_ODY(2e, 5, 6, 16)
HMFSI_ODY(2f, 5, 6, 17)

HMFSI_ODY(30, 6, 7, 00)
HMFSI_ODY(31, 6, 7, 01)
HMFSI_ODY(32, 6, 7, 10)
HMFSI_ODY(33, 6, 7, 11)
HMFSI_ODY(34, 6, 7, 12)
HMFSI_ODY(35, 6, 7, 13)
HMFSI_ODY(36, 6, 7, 14)
HMFSI_ODY(37, 6, 7, 15)

HMFSI_ODY(38, 7, 8, 02)
HMFSI_ODY(39, 7, 8, 03)
HMFSI_ODY(3a, 7, 8, 10)
HMFSI_ODY(3b, 7, 8, 11)
HMFSI_ODY(3c, 7, 8, 14)
HMFSI_ODY(3d, 7, 8, 15)
HMFSI_ODY(3e, 7, 8, 16)
HMFSI_ODY(3f, 7, 8, 17)

};
162 changes: 85 additions & 77 deletions bmc-sbefifo.dts.m4
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,26 @@ dnl HMFSI_ODY([index], [proc], [path-index], [port])
dnl
define(`HMFSI_ODY',
`
hmfsi-ody@$3$4 {
#address-cells = <0x2>;
#size-cells = <0x1>;
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>;
proc = <0x$2>;
port = <$4>;

SBEFIFO_ODY($1, $2, $3, $4)
};
hmfsi-ody@$3$4 {
#address-cells = <0x2>;
#size-cells = <0x1>;
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>;
proc = <0x$2>;
port = <$4>;

SBEFIFO_ODY($1, $2, $3, $4)
};
')dnl

dnl
dnl SBEFIFO_ODY([index], [proc], [path-index], [port] [])
dnl
define(`SBEFIFO_ODY',
`
sbefifo-ody@$3$4{ /* Bogus address */
sbefifo@2400{ /* Bogus address */
#address-cells = <0x2>;
#size-cells = <0x1>;
compatible = "ibm,kernel-sbefifo-ody";
Expand All @@ -125,7 +125,15 @@ define(`SBEFIFO_ODY',
port = <$4>;
device-path = "/dev/sbefifo$3$4";

sbefifo-chipop-ody {
sbefifo-pib {
#address-cells = <0x2>;
#size-cells = <0x1>;
compatible = "ibm,sbefifo-pib-ody";
index = <0x$1>;
system-path = "/proc$2/ocmb$1/pib";
};

sbefifo-chipop {
compatible = "ibm,sbefifo-chipop-ody";
index = <0x$1>;
proc = <0x$2>;
Expand Down Expand Up @@ -195,67 +203,67 @@ define(`BMC_I2CBUS',
HMFSI_ODY(6, 0, 1, 14)
HMFSI_ODY(7, 0, 1, 15)

HMFSI_ODY(0, 1, 2, 02)
HMFSI_ODY(1, 1, 2, 03)
HMFSI_ODY(2, 1, 2, 10)
HMFSI_ODY(3, 1, 2, 11)
HMFSI_ODY(4, 1, 2, 14)
HMFSI_ODY(5, 1, 2, 15)
HMFSI_ODY(6, 1, 2, 16)
HMFSI_ODY(7, 1, 2, 17)


HMFSI_ODY(0, 2, 3, 00)
HMFSI_ODY(1, 2, 3, 01)
HMFSI_ODY(2, 2, 3, 10)
HMFSI_ODY(3, 2, 3, 11)
HMFSI_ODY(4, 2, 3, 12)
HMFSI_ODY(5, 2, 3, 13)
HMFSI_ODY(6, 2, 3, 14)
HMFSI_ODY(7, 2, 3, 15)

HMFSI_ODY(0, 3, 4, 02)
HMFSI_ODY(1, 3, 4, 03)
HMFSI_ODY(2, 3, 4, 10)
HMFSI_ODY(3, 3, 4, 11)
HMFSI_ODY(4, 3, 4, 14)
HMFSI_ODY(5, 3, 4, 15)
HMFSI_ODY(6, 3, 4, 16)
HMFSI_ODY(7, 3, 4, 17)

HMFSI_ODY(0, 4, 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ODY(17, 2, 3, 15)

HMFSI_ODY(18, 3, 4, 02)
HMFSI_ODY(19, 3, 4, 03)
HMFSI_ODY(1a, 3, 4, 10)
HMFSI_ODY(1b, 3, 4, 11)
HMFSI_ODY(1c, 3, 4, 14)
HMFSI_ODY(1d, 3, 4, 15)
HMFSI_ODY(1e, 3, 4, 16)
HMFSI_ODY(1f, 3, 4, 17)

HMFSI_ODY(20, 4, 5, 00)
HMFSI_ODY(21, 4, 5, 01)
HMFSI_ODY(22, 4, 5, 10)
HMFSI_ODY(23, 4, 5, 11)
HMFSI_ODY(24, 4, 5, 12)
HMFSI_ODY(25, 4, 5, 13)
HMFSI_ODY(26, 4, 5, 14)
HMFSI_ODY(27, 4, 5, 15)

HMFSI_ODY(28, 5, 6, 02)
HMFSI_ODY(29, 5, 6, 03)
HMFSI_ODY(2a, 5, 6, 10)
HMFSI_ODY(2b, 5, 6, 11)
HMFSI_ODY(2c, 5, 6, 14)
HMFSI_ODY(2d, 5, 6, 15)
HMFSI_ODY(2e, 5, 6, 16)
HMFSI_ODY(2f, 5, 6, 17)

HMFSI_ODY(30, 6, 7, 00)
HMFSI_ODY(31, 6, 7, 01)
HMFSI_ODY(32, 6, 7, 10)
HMFSI_ODY(33, 6, 7, 11)
HMFSI_ODY(34, 6, 7, 12)
HMFSI_ODY(35, 6, 7, 13)
HMFSI_ODY(36, 6, 7, 14)
HMFSI_ODY(37, 6, 7, 15)

HMFSI_ODY(38, 7, 8, 02)
HMFSI_ODY(39, 7, 8, 03)
HMFSI_ODY(3a, 7, 8, 10)
HMFSI_ODY(3b, 7, 8, 11)
HMFSI_ODY(3c, 7, 8, 14)
HMFSI_ODY(3d, 7, 8, 15)
HMFSI_ODY(3e, 7, 8, 16)
HMFSI_ODY(3f, 7, 8, 17)
};
14 changes: 0 additions & 14 deletions libpdbg/dtb.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,20 +627,6 @@ bool is_ody_ocmb_chip(struct pdbg_target *target)
return false;
}

bool is_child_of_ody_chip(struct pdbg_target *target)
{
struct pdbg_target *ocmb = NULL;
assert(target);

ocmb = pdbg_target_parent("ocmb", target);
/*If it has a parent and the parent is of odyssey ocmb chip
return true */
if( (ocmb) && (is_ody_ocmb_chip(ocmb)) )
return true;

return false;
}

__attribute__((destructor))
static void pdbg_close_targets(void)
{
Expand Down
7 changes: 0 additions & 7 deletions libpdbg/hwunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ struct chipop {
};
#define target_to_chipop(x) container_of(x, struct chipop, target)

struct chipop_ody {
struct pdbg_target target;
uint32_t (*ffdc_get)(struct pdbg_target *, const uint8_t **, uint32_t *);
int (*dump)(struct chipop_ody *, uint8_t, uint8_t, uint8_t, uint8_t **, uint32_t *);
};
#define target_to_chipop_ody(x) container_of(x, struct chipop_ody, target)

struct sbefifo {
struct pdbg_target target;
struct sbefifo_context *sf_ctx;
Expand Down
4 changes: 2 additions & 2 deletions libpdbg/libpdbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,9 @@ struct pdbg_target* get_ody_pib_target(struct pdbg_target* target);
struct pdbg_target* get_ody_fsi_target(struct pdbg_target* target);

/**
* @brief Get the fsi pdbg target for the matching odyssey ocmb chip target
* @brief Get the sbeffifo chipop pdbg target for the matching odyssey ocmb chip target
* @param[in] target ocmb pdbg_target
* @return fsi target
* @return co target
*/
struct pdbg_target* get_ody_chipop_target(struct pdbg_target* target);

Expand Down
Loading

0 comments on commit 664173c

Please sign in to comment.