rcar_gen3: drivers: qos: H3: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I62b133ea4f4129a641b779a782938976ad52fbfe
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
index 6312948..329bcb8 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
@@ -18,51 +18,50 @@
#include "qos_init_h3_v11_mstat.h"
-static void dbsc_setting(void)
-{
+struct rcar_gen3_dbsc_qos_settings h3_v11_qos[] = {
/* BUFCAM settings */
/* DBSC_DBCAM0CNF0 not set */
- io_write_32(DBSC_DBCAM0CNF1, 0x00044218);
- io_write_32(DBSC_DBCAM0CNF2, 0x000000F4);
+ { DBSC_DBCAM0CNF1, 0x00044218 },
+ { DBSC_DBCAM0CNF2, 0x000000F4 },
/* DBSC_DBCAM0CNF3 not set */
- io_write_32(DBSC_DBSCHCNT0, 0x080F0037);
- io_write_32(DBSC_DBSCHCNT1, 0x00001010);
- io_write_32(DBSC_DBSCHSZ0, 0x00000001);
- io_write_32(DBSC_DBSCHRW0, 0x22421111);
+ { DBSC_DBSCHCNT0, 0x080F0037 },
+ { DBSC_DBSCHCNT1, 0x00001010 },
+ { DBSC_DBSCHSZ0, 0x00000001 },
+ { DBSC_DBSCHRW0, 0x22421111 },
/* DDR3 */
- io_write_32(DBSC_SCFCTST2, 0x012F1123);
+ { DBSC_SCFCTST2, 0x012F1123 },
/* QoS Settings */
- io_write_32(DBSC_DBSCHQOS00, 0x0000F000);
- io_write_32(DBSC_DBSCHQOS01, 0x0000E000);
- io_write_32(DBSC_DBSCHQOS02, 0x00007000);
- io_write_32(DBSC_DBSCHQOS03, 0x00000000);
- io_write_32(DBSC_DBSCHQOS40, 0x00000E00);
- io_write_32(DBSC_DBSCHQOS41, 0x00000DFF);
- io_write_32(DBSC_DBSCHQOS42, 0x00000400);
- io_write_32(DBSC_DBSCHQOS43, 0x00000200);
- io_write_32(DBSC_DBSCHQOS90, 0x00000C00);
- io_write_32(DBSC_DBSCHQOS91, 0x00000BFF);
- io_write_32(DBSC_DBSCHQOS92, 0x00000400);
- io_write_32(DBSC_DBSCHQOS93, 0x00000200);
- io_write_32(DBSC_DBSCHQOS130, 0x00000980);
- io_write_32(DBSC_DBSCHQOS131, 0x0000097F);
- io_write_32(DBSC_DBSCHQOS132, 0x00000300);
- io_write_32(DBSC_DBSCHQOS133, 0x00000180);
- io_write_32(DBSC_DBSCHQOS140, 0x00000800);
- io_write_32(DBSC_DBSCHQOS141, 0x000007FF);
- io_write_32(DBSC_DBSCHQOS142, 0x00000300);
- io_write_32(DBSC_DBSCHQOS143, 0x00000180);
- io_write_32(DBSC_DBSCHQOS150, 0x000007D0);
- io_write_32(DBSC_DBSCHQOS151, 0x000007CF);
- io_write_32(DBSC_DBSCHQOS152, 0x000005D0);
- io_write_32(DBSC_DBSCHQOS153, 0x000003D0);
-}
+ { DBSC_DBSCHQOS00, 0x0000F000 },
+ { DBSC_DBSCHQOS01, 0x0000E000 },
+ { DBSC_DBSCHQOS02, 0x00007000 },
+ { DBSC_DBSCHQOS03, 0x00000000 },
+ { DBSC_DBSCHQOS40, 0x00000E00 },
+ { DBSC_DBSCHQOS41, 0x00000DFF },
+ { DBSC_DBSCHQOS42, 0x00000400 },
+ { DBSC_DBSCHQOS43, 0x00000200 },
+ { DBSC_DBSCHQOS90, 0x00000C00 },
+ { DBSC_DBSCHQOS91, 0x00000BFF },
+ { DBSC_DBSCHQOS92, 0x00000400 },
+ { DBSC_DBSCHQOS93, 0x00000200 },
+ { DBSC_DBSCHQOS130, 0x00000980 },
+ { DBSC_DBSCHQOS131, 0x0000097F },
+ { DBSC_DBSCHQOS132, 0x00000300 },
+ { DBSC_DBSCHQOS133, 0x00000180 },
+ { DBSC_DBSCHQOS140, 0x00000800 },
+ { DBSC_DBSCHQOS141, 0x000007FF },
+ { DBSC_DBSCHQOS142, 0x00000300 },
+ { DBSC_DBSCHQOS143, 0x00000180 },
+ { DBSC_DBSCHQOS150, 0x000007D0 },
+ { DBSC_DBSCHQOS151, 0x000007CF },
+ { DBSC_DBSCHQOS152, 0x000005D0 },
+ { DBSC_DBSCHQOS153, 0x000003D0 },
+};
void qos_init_h3_v11(void)
{
- dbsc_setting();
+ rcar_qos_dbsc_setting(h3_v11_qos, ARRAY_SIZE(h3_v11_qos), false);
/* DRAM Split Address mapping */
#if (RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_4CH) || \