reset-socfpga: Fix nr_resets property
authorRojhalat Ibrahim <imr@rtschenk.de>
Wed, 15 Feb 2017 18:10:58 +0000 (19:10 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 8 Mar 2017 08:36:45 +0000 (09:36 +0100)
commitd518d9cab17d42f04da3b1de001693bb8780e39e
tree9a4a0f13dc5789b14e96ad4929502b2ed4c5d0a0
parent716adfe3f0806d2a607bada871af6cc2e08eb490
reset-socfpga: Fix nr_resets property

The SoC-FPGA reset controller driver defines NR_BANKS as 4 and uses that define
for two unrelated purposes. It is used
1. as an increment for reset line banks which are 32-bit registers with 4-byte
aligned addresses.
2. as the total number of reset line banks which together with the number of
resets per bank (32) limits the total number of useable resets to 128 and the
highest useable reset ID to 127.

This is clearly wrong as there are resets with higher IDs than 127 defined in
include/dt-bindings/reset/altr,rst-mgr.h and altr,rst-mgr-a10.h.

The patch introduces a new define BANK_INCREMENT for calculating the register
addresses as before and increases NR_BANKS to 8 for useable reset IDs up to 255.

Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/reset-socfpga.c