[Skiboot] [PATCH] platforms/firenze: Fix clock frequency dt property
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Wed Sep 28 16:23:57 AEST 2016
Commit 5cda6f6d added 8 byte property instead of 4 byte..which resulted
in below calltrace.
I think its fine to convert u64 to u32 here as we devide bus frequency
by 4.
Backtrace:
----------
[ 1.212366090,3] DT: Unexpected property length /xscom at 3fc0000000000/i2cm at a0020/clock-frequency
[ 1.212369108,3] DT: Expected len: 4 got len: 8
[ 1.212370117,0] Assert fail: core/device.c:603:0
[ 1.212371550,0] Aborting!
CPU 0870 Backtrace:
S: 0000000033dc39e0 R: 0000000030013758 .backtrace+0x24
S: 0000000033dc3a60 R: 0000000030018e0c ._abort+0x4c
S: 0000000033dc3ae0 R: 0000000030018e88 .assert_fail+0x34
S: 0000000033dc3b60 R: 0000000030023da4 .dt_require_property+0xb4
S: 0000000033dc3bf0 R: 000000003002403c .dt_prop_get_u32+0x14
S: 0000000033dc3c60 R: 000000003004e884 .p8_i2c_init+0x12c
S: 0000000033dc3e30 R: 0000000030014684 .main_cpu_entry+0x4a8
S: 0000000033dc3f00 R: 00000000300025a0 boot_entry+0x198
Fixes: 5cda6f6d (platforms/firenze: Fix I2C clock source frequency)
Reported-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
CC: Gavin Shan <gwshan at linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
platforms/ibm-fsp/firenze.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/platforms/ibm-fsp/firenze.c b/platforms/ibm-fsp/firenze.c
index 00aba8d..cc626c0 100644
--- a/platforms/ibm-fsp/firenze.c
+++ b/platforms/ibm-fsp/firenze.c
@@ -34,6 +34,7 @@ static struct dt_node *dt_create_i2c_master(struct dt_node *n, uint32_t eng_id)
{
struct dt_node *i2cm;
uint64_t freq;
+ uint32_t clock;
/* Each master registers set is of length 0x20 */
i2cm = dt_new_addr(n, "i2cm", 0xa0000 + eng_id * 0x20);
@@ -50,13 +51,11 @@ static struct dt_node *dt_create_i2c_master(struct dt_node *n, uint32_t eng_id)
/* Derive the clock source frequency */
freq = dt_prop_get_u64_def(n, "bus-frequency", 0);
- freq /= 4;
- if (freq)
- dt_add_property_cells(i2cm, "clock-frequency",
- hi32(freq), lo32(freq));
+ clock = (u32)(freq / 4);
+ if (clock)
+ dt_add_property_cells(i2cm, "clock-frequency", clock);
else
- dt_add_property_cells(i2cm, "clock-frequency",
- 125000000);
+ dt_add_property_cells(i2cm, "clock-frequency", 125000000);
return i2cm;
}
--
2.5.5
More information about the Skiboot
mailing list