[U-Boot] [PATCH 1/8] arm: rmobile: lager: Update QoS initialization to version 0.955

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/lager/qos.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/board/renesas/lager/qos.c b/board/renesas/lager/qos.c index f1ac060..3742757 100644 --- a/board/renesas/lager/qos.c +++ b/board/renesas/lager/qos.c @@ -12,7 +12,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h>
-/* QoS version 0.954 */ +/* QoS version 0.955 */
enum { DBSC3_R00, DBSC3_R01, DBSC3_R02, DBSC3_R03, DBSC3_R04, @@ -475,7 +475,7 @@ void qos_init(void) axi_qos = (struct rcar_axi_qos *)MP_AXI_ASDS0_BASE; writel(0x00000001, &axi_qos->qosconf); writel(0x00002014, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000040, &axi_qos->qosreqctr); writel(0x00002006, &axi_qos->qosthres0); writel(0x00002001, &axi_qos->qosthres1); writel(0x00000000, &axi_qos->qosthres2); @@ -484,19 +484,19 @@ void qos_init(void) axi_qos = (struct rcar_axi_qos *)MP_AXI_ASDS1_BASE; writel(0x00000001, &axi_qos->qosconf); writel(0x00002014, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000040, &axi_qos->qosreqctr); writel(0x00002006, &axi_qos->qosthres0); writel(0x00002001, &axi_qos->qosthres1); writel(0x00000000, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon);
axi_qos = (struct rcar_axi_qos *)MP_AXI_MLP_BASE; - writel(0x00000000, &axi_qos->qosconf); - writel(0x00002002, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosconf); + writel(0x00001FF0, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); writel(0x00002006, &axi_qos->qosthres0); writel(0x00002001, &axi_qos->qosthres1); - writel(0x00000000, &axi_qos->qosthres2); + writel(0x00002001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon);
axi_qos = (struct rcar_axi_qos *)MP_AXI_MMUMP_BASE;

This update QoS version 0.240 for ES1 and version 0.310 for ES2.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/koelsch/qos.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/board/renesas/koelsch/qos.c b/board/renesas/koelsch/qos.c index d82bf8b..e6c5e48 100644 --- a/board/renesas/koelsch/qos.c +++ b/board/renesas/koelsch/qos.c @@ -13,7 +13,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h>
-/* QoS version 0.23 for ES1 and version 0.303 for ES2 */ +/* QoS version 0.240 for ES1 and version 0.310 for ES2 */
enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, @@ -233,13 +233,11 @@ void qos_init(void) writel(0x00000001, &qos_addr->dblgqon); }
- if (!IS_R8A7791_ES2()) { - /* CCI-400 -QoS */ - writel(0x20001000, CCI_400_MAXOT_1); - writel(0x20001000, CCI_400_MAXOT_2); - writel(0x0000000C, CCI_400_QOSCNTL_1); - writel(0x0000000C, CCI_400_QOSCNTL_2); - } + /* CCI-400 -QoS */ + writel(0x20001000, CCI_400_MAXOT_1); + writel(0x20001000, CCI_400_MAXOT_2); + writel(0x0000000C, CCI_400_QOSCNTL_1); + writel(0x0000000C, CCI_400_QOSCNTL_2);
/* MXI -QoS */ /* Transaction Control (MXI) */ @@ -700,9 +698,6 @@ void qos_init(void) axi_qos = (struct rcar_axi_qos *)RT_AXI_SY2RT_BASE; writel(0x00000002, &axi_qos->qosconf); writel(0x00002245, &axi_qos->qosctset0); - writel(0x00002096, &axi_qos->qosctset1); - writel(0x00002030, &axi_qos->qosctset2); - writel(0x00002030, &axi_qos->qosctset3); writel(0x00000001, &axi_qos->qosreqctr); writel(0x00002064, &axi_qos->qosthres0); writel(0x00002004, &axi_qos->qosthres1); @@ -722,7 +717,7 @@ void qos_init(void) axi_qos = (struct rcar_axi_qos *)MP_AXI_ASDS0_BASE; writel(0x00000001, &axi_qos->qosconf); writel(0x00002014, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000040, &axi_qos->qosreqctr); writel(0x00002064, &axi_qos->qosthres0); writel(0x00002004, &axi_qos->qosthres1); writel(0x00000000, &axi_qos->qosthres2); @@ -731,19 +726,19 @@ void qos_init(void) axi_qos = (struct rcar_axi_qos *)MP_AXI_ASDS1_BASE; writel(0x00000001, &axi_qos->qosconf); writel(0x00002014, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000040, &axi_qos->qosreqctr); writel(0x00002064, &axi_qos->qosthres0); writel(0x00002004, &axi_qos->qosthres1); writel(0x00000000, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon);
axi_qos = (struct rcar_axi_qos *)MP_AXI_MLP_BASE; - writel(0x00000000, &axi_qos->qosconf); - writel(0x00002014, &axi_qos->qosctset0); - writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosconf); + writel(0x00001FF0, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); writel(0x00002064, &axi_qos->qosthres0); writel(0x00002004, &axi_qos->qosthres1); - writel(0x00000000, &axi_qos->qosthres2); + writel(0x00002001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon);
axi_qos = (struct rcar_axi_qos *)MP_AXI_MMUMP_BASE;

CONFIG_SH_TMU_CLK_FREQ of koelsch is calculated from the external clock. This defines RMOBILE_XTAL_CLK, this updates the calculation of CONFIG_SH_TMU_CLK_FREQ.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- include/configs/koelsch.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h index 7db6086..1a93d17 100644 --- a/include/configs/koelsch.h +++ b/include/configs/koelsch.h @@ -135,8 +135,9 @@ #define CONFIG_SH_ETHER_ALIGNE_SIZE 64
/* Board Clock */ -#define CONFIG_SYS_CLK_FREQ 10000000 -#define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ +#define RMOBILE_XTAL_CLK 20000000u +#define CONFIG_SYS_CLK_FREQ RMOBILE_XTAL_CLK +#define CONFIG_SH_TMU_CLK_FREQ (CONFIG_SYS_CLK_FREQ / 2) #define CONFIG_SH_SCIF_CLK_FREQ 14745600 #define CONFIG_SYS_TMU_CLK_DIV 4

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- arch/arm/include/asm/arch-rmobile/rcar-base.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/include/asm/arch-rmobile/rcar-base.h b/arch/arm/include/asm/arch-rmobile/rcar-base.h index 371f0ed..4331d31 100644 --- a/arch/arm/include/asm/arch-rmobile/rcar-base.h +++ b/arch/arm/include/asm/arch-rmobile/rcar-base.h @@ -374,6 +374,10 @@ #define CCI_AXI_IPMMUDSDVMCR 0xFF880414 #define CCI_AXI_AX2ADDRMASK 0xFF88041C
+#define PLL0CR 0xE61500D8 +#define PLL0_STC_MASK 0x7F000000 +#define PLL0_STC_BIT 24 + #ifndef __ASSEMBLY__ #include <asm/types.h>

Maximum CPU clock of R8A7791 that are used in koelsch board is 1.5GHz. This change to use the maximum clock in this board.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/koelsch/koelsch.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c index d4f6372..bfd0cc6 100644 --- a/board/renesas/koelsch/koelsch.c +++ b/board/renesas/koelsch/koelsch.c @@ -19,19 +19,26 @@ #include <netdev.h> #include <miiphy.h> #include <i2c.h> +#include <div64.h> #include "qos.h"
DECLARE_GLOBAL_DATA_PTR;
+#define CLK2MHZ(clk) (clk / 1000 / 1000) void s_init(void) { struct rcar_rwdt *rwdt = (struct rcar_rwdt *)RWDT_BASE; struct rcar_swdt *swdt = (struct rcar_swdt *)SWDT_BASE; + u32 stc;
/* Watchdog init */ writel(0xA5A5A500, &rwdt->rwtcsra); writel(0xA5A5A500, &swdt->swtcsra);
+ /* CPU frequency setting. Set to 1.5GHz */ + stc = ((1500 / CLK2MHZ(CONFIG_SYS_CLK_FREQ)) - 1) << PLL0_STC_BIT; + clrsetbits_le32(PLL0CR, PLL0_STC_MASK, stc); + /* QoS */ qos_init(); }

CONFIG_SH_TMU_CLK_FREQ of lager is calculated from the external clock. This defines RMOBILE_XTAL_CLK, this updates the calculation of CONFIG_SH_TMU_CLK_FREQ.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- include/configs/lager.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/configs/lager.h b/include/configs/lager.h index 5ddefef..269cfec 100644 --- a/include/configs/lager.h +++ b/include/configs/lager.h @@ -155,9 +155,10 @@ #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */
/* Board Clock */ -#define CONFIG_BASE_CLK_FREQ 20000000u -#define CONFIG_SH_TMU_CLK_FREQ (CONFIG_BASE_CLK_FREQ / 2) /* EXT / 2 */ -#define CONFIG_PLL1_CLK_FREQ (CONFIG_BASE_CLK_FREQ * 156 / 2) +#define RMOBILE_XTAL_CLK 20000000u +#define CONFIG_SYS_CLK_FREQ RMOBILE_XTAL_CLK +#define CONFIG_SH_TMU_CLK_FREQ (CONFIG_SYS_CLK_FREQ / 2) /* EXT / 2 */ +#define CONFIG_PLL1_CLK_FREQ (CONFIG_SYS_CLK_FREQ * 156 / 2) #define CONFIG_PLL1_DIV2_CLK_FREQ (CONFIG_PLL1_CLK_FREQ / 2) #define CONFIG_MP_CLK_FREQ (CONFIG_PLL1_DIV2_CLK_FREQ / 15) #define CONFIG_HP_CLK_FREQ (CONFIG_PLL1_CLK_FREQ / 12)

Maximum CPU clock of R8A7790 that are used in lager board is 1.4GHz. This change to use the maximum clock in this board.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/lager/lager.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 959f46a..898fb57 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -24,15 +24,21 @@
DECLARE_GLOBAL_DATA_PTR;
+#define CLK2MHZ(clk) (clk / 1000 / 1000) void s_init(void) { struct rcar_rwdt *rwdt = (struct rcar_rwdt *)RWDT_BASE; struct rcar_swdt *swdt = (struct rcar_swdt *)SWDT_BASE; + u32 stc;
/* Watchdog init */ writel(0xA5A5A500, &rwdt->rwtcsra); writel(0xA5A5A500, &swdt->swtcsra);
+ /* CPU frequency setting. Set to 1.4GHz */ + stc = ((1500 / CLK2MHZ(CONFIG_SYS_CLK_FREQ)) - 1) << PLL0_STC_BIT; + clrsetbits_le32(PLL0CR, PLL0_STC_MASK, stc); + /* QoS(Quality-of-Service) Init */ qos_init(); }

MACH_TYPE_LAGER and CONFIG_MACH_TYPE are not already available on Lager board. This removes them.
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/lager/lager.c | 2 -- include/configs/lager.h | 2 -- 2 files changed, 4 deletions(-)
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 898fb57..a5a0474 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -85,8 +85,6 @@ void arch_preboot_os(void) DECLARE_GLOBAL_DATA_PTR; int board_init(void) { - /* board id for linux */ - gd->bd->bi_arch_number = MACH_TYPE_LAGER; /* adress of boot parameters */ gd->bd->bi_boot_params = LAGER_SDRAM_BASE + 0x100;
diff --git a/include/configs/lager.h b/include/configs/lager.h index 269cfec..ac31128 100644 --- a/include/configs/lager.h +++ b/include/configs/lager.h @@ -16,8 +16,6 @@ #define CONFIG_RMOBILE #define CONFIG_RMOBILE_BOARD_STRING "Lager" #define CONFIG_SH_GPIO_PFC -#define MACH_TYPE_LAGER 4538 -#define CONFIG_MACH_TYPE MACH_TYPE_LAGER
#include <asm/arch/rmobile.h>
participants (1)
-
Nobuhiro Iwamatsu