* [PATCH 1/4] MIPS: ath79: pbl: import AR9331 CP0 init routine from U-Boot_mod
2016-02-25 9:14 [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod Antony Pavlov
@ 2016-02-25 9:14 ` Antony Pavlov
2016-02-25 15:23 ` Yegor Yefremov
2016-02-25 9:14 ` [PATCH 2/4] MIPS: ath79: pbl: import hornet_1_1_war " Antony Pavlov
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Antony Pavlov @ 2016-02-25 9:14 UTC (permalink / raw)
To: barebox
U-Boot_mod is a popular bootloader for Atheros AR93xx chips,
please see https://github.com/pepe2k/u-boot_mod for details.
It's reasonable to import some lowlevel AR9331 initialization
code from U-Boot_mod.
This patch imports AR9331 MIPS24K coprocessor0 initialization
code from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/mach-ath79/include/mach/pbl_macros.h | 44 ++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
index c00dd28..810f49d 100644
--- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
+++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
@@ -179,4 +179,48 @@
| AR933X_GPIO_FUNC_RSRV15, GPIO_FUNC
.endm
+.macro hornet_mips24k_cp0_setup
+ .set push
+ .set noreorder
+
+ /*
+ * Clearing CP0 registers - This is generally required for the MIPS-24k
+ * core used by Atheros.
+ */
+ mtc0 zero, CP0_INDEX
+ mtc0 zero, CP0_ENTRYLO0
+ mtc0 zero, CP0_ENTRYLO1
+ mtc0 zero, CP0_CONTEXT
+ mtc0 zero, CP0_PAGEMASK
+ mtc0 zero, CP0_WIRED
+ mtc0 zero, CP0_INFO
+ mtc0 zero, CP0_COUNT
+ mtc0 zero, CP0_ENTRYHI
+ mtc0 zero, CP0_COMPARE
+
+ li t0, ST0_CU0 | ST0_ERL
+ mtc0 t0, CP0_STATUS
+
+ mtc0 zero, CP0_CAUSE
+ mtc0 zero, CP0_EPC
+
+ li t0, CONF_CM_UNCACHED
+ mtc0 t0, CP0_CONFIG
+
+ mtc0 zero, CP0_LLADDR
+ mtc0 zero, CP0_WATCHLO
+ mtc0 zero, CP0_WATCHHI
+ mtc0 zero, CP0_XCONTEXT
+ mtc0 zero, CP0_FRAMEMASK
+ mtc0 zero, CP0_DIAGNOSTIC
+ mtc0 zero, CP0_DEBUG
+ mtc0 zero, CP0_DEPC
+ mtc0 zero, CP0_PERFORMANCE
+ mtc0 zero, CP0_ECC
+ mtc0 zero, CP0_CACHEERR
+ mtc0 zero, CP0_TAGLO
+
+ .set pop
+.endm
+
#endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] MIPS: ath79: pbl: import AR9331 CP0 init routine from U-Boot_mod
2016-02-25 9:14 ` [PATCH 1/4] MIPS: ath79: pbl: import AR9331 CP0 init routine " Antony Pavlov
@ 2016-02-25 15:23 ` Yegor Yefremov
0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2016-02-25 15:23 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Thu, Feb 25, 2016 at 10:14 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> U-Boot_mod is a popular bootloader for Atheros AR93xx chips,
> please see https://github.com/pepe2k/u-boot_mod for details.
>
> It's reasonable to import some lowlevel AR9331 initialization
> code from U-Boot_mod.
>
> This patch imports AR9331 MIPS24K coprocessor0 initialization
> code from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S.
>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/mips/mach-ath79/include/mach/pbl_macros.h | 44 ++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
> index c00dd28..810f49d 100644
> --- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
> +++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
> @@ -179,4 +179,48 @@
> | AR933X_GPIO_FUNC_RSRV15, GPIO_FUNC
> .endm
>
> +.macro hornet_mips24k_cp0_setup
> + .set push
> + .set noreorder
> +
> + /*
> + * Clearing CP0 registers - This is generally required for the MIPS-24k
> + * core used by Atheros.
> + */
> + mtc0 zero, CP0_INDEX
> + mtc0 zero, CP0_ENTRYLO0
> + mtc0 zero, CP0_ENTRYLO1
> + mtc0 zero, CP0_CONTEXT
> + mtc0 zero, CP0_PAGEMASK
> + mtc0 zero, CP0_WIRED
> + mtc0 zero, CP0_INFO
> + mtc0 zero, CP0_COUNT
> + mtc0 zero, CP0_ENTRYHI
> + mtc0 zero, CP0_COMPARE
> +
> + li t0, ST0_CU0 | ST0_ERL
> + mtc0 t0, CP0_STATUS
> +
> + mtc0 zero, CP0_CAUSE
> + mtc0 zero, CP0_EPC
> +
> + li t0, CONF_CM_UNCACHED
> + mtc0 t0, CP0_CONFIG
> +
> + mtc0 zero, CP0_LLADDR
> + mtc0 zero, CP0_WATCHLO
> + mtc0 zero, CP0_WATCHHI
> + mtc0 zero, CP0_XCONTEXT
> + mtc0 zero, CP0_FRAMEMASK
> + mtc0 zero, CP0_DIAGNOSTIC
> + mtc0 zero, CP0_DEBUG
> + mtc0 zero, CP0_DEPC
> + mtc0 zero, CP0_PERFORMANCE
> + mtc0 zero, CP0_ECC
> + mtc0 zero, CP0_CACHEERR
> + mtc0 zero, CP0_TAGLO
> +
> + .set pop
> +.endm
> +
> #endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
> --
> 2.7.0
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] MIPS: ath79: pbl: import hornet_1_1_war routine from U-Boot_mod
2016-02-25 9:14 [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod Antony Pavlov
2016-02-25 9:14 ` [PATCH 1/4] MIPS: ath79: pbl: import AR9331 CP0 init routine " Antony Pavlov
@ 2016-02-25 9:14 ` Antony Pavlov
2016-02-25 15:23 ` Yegor Yefremov
2016-02-25 9:14 ` [PATCH 3/4] MIPS: tplink-mr3020: pbl: use more lowlevel init code " Antony Pavlov
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Antony Pavlov @ 2016-02-25 9:14 UTC (permalink / raw)
To: barebox
U-Boot_mod is a popular bootloader for Atheros AR93xx chips,
please see https://github.com/pepe2k/u-boot_mod for details.
It's reasonable to import some lowlevel AR9331 initialization
code from U-Boot_mod.
AR9331 (Hornet) 1.1 currently needs an additional
reset at 1st boot. This patch imports necessary code
from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/mach-ath79/include/mach/pbl_macros.h | 43 ++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
index 810f49d..24cfd60 100644
--- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
+++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
@@ -223,4 +223,47 @@
.set pop
.endm
+.macro hornet_1_1_war
+ .set push
+ .set noreorder
+
+/*
+ * WAR: Hornet 1.1 currently need a reset once we boot to let the resetb has
+ * enough time to stable, so that trigger reset at 1st boot, system team
+ * is investigaing the issue, will remove in short
+ */
+
+ li t7, 0xbd000000
+ lw t8, 0(t7)
+ li t9, 0x12345678
+
+ /* if value of 0xbd000000 != 0x12345678, go to do_reset */
+ bne t8, t9, do_reset
+ nop
+
+ li t9, 0xffffffff
+ sw t9, 0(t7)
+ b normal_path
+ nop
+
+do_reset:
+ /* put 0x12345678 into 0xbd000000 */
+ sw t9, 0(t7)
+
+ /* reset register 0x1806001c */
+ li t7, 0xb806001c
+ lw t8, 0(t7)
+ /* bit24, fullchip reset */
+ li t9, 0x1000000
+ or t8, t8, t9
+ sw t8, 0(t7)
+
+do_reset_loop:
+ b do_reset_loop
+ nop
+
+normal_path:
+ .set pop
+.endm
+
#endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] MIPS: ath79: pbl: import hornet_1_1_war routine from U-Boot_mod
2016-02-25 9:14 ` [PATCH 2/4] MIPS: ath79: pbl: import hornet_1_1_war " Antony Pavlov
@ 2016-02-25 15:23 ` Yegor Yefremov
0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2016-02-25 15:23 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Thu, Feb 25, 2016 at 10:14 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> U-Boot_mod is a popular bootloader for Atheros AR93xx chips,
> please see https://github.com/pepe2k/u-boot_mod for details.
>
> It's reasonable to import some lowlevel AR9331 initialization
> code from U-Boot_mod.
>
> AR9331 (Hornet) 1.1 currently needs an additional
> reset at 1st boot. This patch imports necessary code
> from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S.
>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/mips/mach-ath79/include/mach/pbl_macros.h | 43 ++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
> index 810f49d..24cfd60 100644
> --- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
> +++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
> @@ -223,4 +223,47 @@
> .set pop
> .endm
>
> +.macro hornet_1_1_war
> + .set push
> + .set noreorder
> +
> +/*
> + * WAR: Hornet 1.1 currently need a reset once we boot to let the resetb has
> + * enough time to stable, so that trigger reset at 1st boot, system team
> + * is investigaing the issue, will remove in short
> + */
> +
> + li t7, 0xbd000000
> + lw t8, 0(t7)
> + li t9, 0x12345678
> +
> + /* if value of 0xbd000000 != 0x12345678, go to do_reset */
> + bne t8, t9, do_reset
> + nop
> +
> + li t9, 0xffffffff
> + sw t9, 0(t7)
> + b normal_path
> + nop
> +
> +do_reset:
> + /* put 0x12345678 into 0xbd000000 */
> + sw t9, 0(t7)
> +
> + /* reset register 0x1806001c */
> + li t7, 0xb806001c
> + lw t8, 0(t7)
> + /* bit24, fullchip reset */
> + li t9, 0x1000000
> + or t8, t8, t9
> + sw t8, 0(t7)
> +
> +do_reset_loop:
> + b do_reset_loop
> + nop
> +
> +normal_path:
> + .set pop
> +.endm
> +
> #endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
> --
> 2.7.0
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/4] MIPS: tplink-mr3020: pbl: use more lowlevel init code from U-Boot_mod
2016-02-25 9:14 [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod Antony Pavlov
2016-02-25 9:14 ` [PATCH 1/4] MIPS: ath79: pbl: import AR9331 CP0 init routine " Antony Pavlov
2016-02-25 9:14 ` [PATCH 2/4] MIPS: ath79: pbl: import hornet_1_1_war " Antony Pavlov
@ 2016-02-25 9:14 ` Antony Pavlov
2016-02-25 15:23 ` Yegor Yefremov
2016-02-25 9:14 ` [PATCH 4/4] MIPS: black-swift: " Antony Pavlov
2016-02-26 6:51 ` [PATCH 0/4] MIPS: ath79: " Sascha Hauer
4 siblings, 1 reply; 10+ messages in thread
From: Antony Pavlov @ 2016-02-25 9:14 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h b/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
index d25f5aa..ae548c9 100644
--- a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
+++ b/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
@@ -26,10 +26,12 @@
mips_barebox_10h
- mips_disable_interrupts
+ hornet_mips24k_cp0_setup
pbl_blt 0xbf000000 skip_pll_ram_config t8
+ hornet_1_1_war
+
pbl_ar9331_pll
pbl_ar9331_ddr1_config
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] MIPS: tplink-mr3020: pbl: use more lowlevel init code from U-Boot_mod
2016-02-25 9:14 ` [PATCH 3/4] MIPS: tplink-mr3020: pbl: use more lowlevel init code " Antony Pavlov
@ 2016-02-25 15:23 ` Yegor Yefremov
0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2016-02-25 15:23 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Thu, Feb 25, 2016 at 10:14 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h b/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
> index d25f5aa..ae548c9 100644
> --- a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
> +++ b/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
> @@ -26,10 +26,12 @@
>
> mips_barebox_10h
>
> - mips_disable_interrupts
> + hornet_mips24k_cp0_setup
>
> pbl_blt 0xbf000000 skip_pll_ram_config t8
>
> + hornet_1_1_war
> +
> pbl_ar9331_pll
> pbl_ar9331_ddr1_config
>
> --
> 2.7.0
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/4] MIPS: black-swift: pbl: use more lowlevel init code from U-Boot_mod
2016-02-25 9:14 [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod Antony Pavlov
` (2 preceding siblings ...)
2016-02-25 9:14 ` [PATCH 3/4] MIPS: tplink-mr3020: pbl: use more lowlevel init code " Antony Pavlov
@ 2016-02-25 9:14 ` Antony Pavlov
2016-02-25 15:23 ` Yegor Yefremov
2016-02-26 6:51 ` [PATCH 0/4] MIPS: ath79: " Sascha Hauer
4 siblings, 1 reply; 10+ messages in thread
From: Antony Pavlov @ 2016-02-25 9:14 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/boards/black-swift/include/board/board_pbl_start.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/mips/boards/black-swift/include/board/board_pbl_start.h b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
index 7394092..3f2caa0 100644
--- a/arch/mips/boards/black-swift/include/board/board_pbl_start.h
+++ b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
@@ -26,10 +26,12 @@
mips_barebox_10h
- mips_disable_interrupts
+ hornet_mips24k_cp0_setup
pbl_blt 0xbf000000 skip_pll_ram_config t8
+ hornet_1_1_war
+
pbl_ar9331_pll
pbl_ar9331_ddr2_config
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] MIPS: black-swift: pbl: use more lowlevel init code from U-Boot_mod
2016-02-25 9:14 ` [PATCH 4/4] MIPS: black-swift: " Antony Pavlov
@ 2016-02-25 15:23 ` Yegor Yefremov
0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2016-02-25 15:23 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Thu, Feb 25, 2016 at 10:14 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/mips/boards/black-swift/include/board/board_pbl_start.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/boards/black-swift/include/board/board_pbl_start.h b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
> index 7394092..3f2caa0 100644
> --- a/arch/mips/boards/black-swift/include/board/board_pbl_start.h
> +++ b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
> @@ -26,10 +26,12 @@
>
> mips_barebox_10h
>
> - mips_disable_interrupts
> + hornet_mips24k_cp0_setup
>
> pbl_blt 0xbf000000 skip_pll_ram_config t8
>
> + hornet_1_1_war
> +
> pbl_ar9331_pll
> pbl_ar9331_ddr2_config
>
> --
> 2.7.0
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod
2016-02-25 9:14 [PATCH 0/4] MIPS: ath79: pbl: use more lowlevel init code from U-Boot_mod Antony Pavlov
` (3 preceding siblings ...)
2016-02-25 9:14 ` [PATCH 4/4] MIPS: black-swift: " Antony Pavlov
@ 2016-02-26 6:51 ` Sascha Hauer
4 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2016-02-26 6:51 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Thu, Feb 25, 2016 at 12:14:49PM +0300, Antony Pavlov wrote:
> U-Boot_mod is a popular bootloader for Atheros AR93xx chips,
> please see https://github.com/pepe2k/u-boot_mod for details.
>
> It's reasonable to import some lowlevel AR9331 initialization
> code from U-Boot_mod.
>
> Antony Pavlov (4):
> MIPS: ath79: pbl: import AR9331 CP0 init routine from U-Boot_mod
> MIPS: ath79: pbl: import hornet_1_1_war routine from U-Boot_mod
> MIPS: tplink-mr3020: pbl: use more lowlevel init code from U-Boot_mod
> MIPS: black-swift: pbl: use more lowlevel init code from U-Boot_mod
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread