diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2016-09-28 11:53:57 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-09-28 16:39:42 +1000 |
commit | 94125da004650df0133e7dbdbd8c3833c53b4902 (patch) | |
tree | d40ba91b59aea7f1d01ed47864a329057f2cbc52 /platforms/ibm-fsp | |
parent | 5acf424ad6e1376f0513262b5f9ffdd00e83a94a (diff) | |
download | blackbird-skiboot-94125da004650df0133e7dbdbd8c3833c53b4902.tar.gz blackbird-skiboot-94125da004650df0133e7dbdbd8c3833c53b4902.zip |
platforms/firenze: Fix clock frequency dt property
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@3fc0000000000/i2cm@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)
Fixes: 5acf424a (HDAT: Fix typo in nest-frequency property)
Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
CC: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/ibm-fsp')
-rw-r--r-- | platforms/ibm-fsp/firenze.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/platforms/ibm-fsp/firenze.c b/platforms/ibm-fsp/firenze.c index 00aba8d3..cc626c04 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; } |