From: Weijie Gao <weijie.gao@mediatek.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 05/18] arm: MediaTek: add basic support for MT7623 boards
Date: Mon, 19 Nov 2018 15:15:59 +0800 [thread overview]
Message-ID: <1542611759.18546.65.camel@mcddlt001> (raw)
In-Reply-To: <CAPnjgZ1BRyXVvVEsvPKaWs357Ew6bQBGFmea16pFcsb1eSV3Ow@mail.gmail.com>
On Fri, 2018-11-16 at 11:26 -0700, Simon Glass wrote:
> Hi Weijie,
>
> On 15 November 2018 at 23:08, Weijie Gao <weijie.gao@mediatek.com>
> wrote:
> > On Thu, 2018-11-15 at 11:21 -0800, Simon Glass wrote:
> >> Hi,
> >>
> >> On 14 November 2018 at 18:07, Ryder Lee <ryder.lee@mediatek.com>
> wrote:
> >> > From: Weijie Gao <weijie.gao@mediatek.com>
> >> >
> >> > This adds a general board file based on MT7623 SoCs from
> MediaTek.
> >> >
> >> > As this u-boot is loaded by MTK proprietary preloader, there is
> no
> >> > low level initializtion codes.
> >> >
> >> > Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> >> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> >> > Tested-by: Matthias Brugger <matthias.bgg@gmail.com>
> >> > ---
> >> > Changes since v5: None
> >> > Changes since v4:
> >> > -Add gd->bd->bi_boot_params for legacy method - ATAGs.
> >> > ---
> >> > arch/arm/mach-mediatek/Kconfig | 13 ++++
> >> > arch/arm/mach-mediatek/Makefile | 1 +
> >> > arch/arm/mach-mediatek/mt7623/Makefile | 4 ++
> >> > arch/arm/mach-mediatek/mt7623/init.c | 54
> +++++++++++++++
> >> > arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++
> >> > arch/arm/mach-mediatek/mt7623/preloader.h | 99
> +++++++++++++++++++++++++++
> >> > board/mediatek/mt7623/Kconfig | 13 ++++
> >> > board/mediatek/mt7623/MAINTAINERS | 7 ++
> >> > board/mediatek/mt7623/Makefile | 3 +
> >> > board/mediatek/mt7623/mt7623_rfb.c | 16 +++++
> >> > configs/mt7623n_bpir2_defconfig | 54
> +++++++++++++++
> >> > include/configs/mt7623.h | 56
> +++++++++++++++
> >> > 12 files changed, 342 insertions(+)
> >> > create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile
> >> > create mode 100644 arch/arm/mach-mediatek/mt7623/init.c
> >> > create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S
> >> > create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h
> >> > create mode 100644 board/mediatek/mt7623/Kconfig
> >> > create mode 100644 board/mediatek/mt7623/MAINTAINERS
> >> > create mode 100644 board/mediatek/mt7623/Makefile
> >> > create mode 100644 board/mediatek/mt7623/mt7623_rfb.c
> >> > create mode 100644 configs/mt7623n_bpir2_defconfig
> >> > create mode 100644 include/configs/mt7623.h
> >>
> >> Can this use the bloblist feature which should land soon?
> >>
> >> For now, see dm/spl-working.
> >>
> >> Regards,
> >> Simon
> >
> > Hi Simon,
> >
> > I've read the code for spl handoff. It's a good way though but
> > unfortunately it cannot be applied to the MT7623 boards.
> >
> > The reason is that MT7623 uses a MediaTek proprietary preloader
> which
> > has the same function as the U-Boot SPL. But the preloader is
> > close-sourced (by company policy) and only available in binary
> release.
> > This means we can't use a real U-Boot SPL to replace the preloader.
>
> Can you work to get U-Boot SPL running on the chip?
>
> What is the reason for the proprietary SPL?
>
> >
> > At present this chip has already been used in many products. We
> can't
> > either release a different preloader which introduces compatibility
> > issues.
>
> What sort of compatibility issues? I cannot see any advantage with a
> proprietary SPL.
>
> >
> > So the conclusion is that we cannot use the bloblist feature for
> this
> > SoC.
>
> Regards,
> Simon
>
Hi Simon,
Sorry for that I didn't describe the function of the preloader clearly.
The MT7623 is like a smart phone SoC which has the ability to upgrade
bootloader/firmware via a USB cable. This function is always available
even if there is no valid preloader/bootloader.
This is done by cooperation of the BootROM and preloader. This is a
simple description of the flow:
1. Connect the MT7623 board to the PC using USB cable. Do not power up.
2. Run MediaTek's FlashTool and start downloading.
3. Power up the board.
4. The BootROM will initialize the USB device immediately for few
seconds and waiting for commands from PC.
5. The PC will start transmit commands to the board as soon as it
detects the board device.
6. Thee BootROM will then download the preloader into SRAM, and run it.
Several informations will be passed to the preloader, to let it
continue to communicate with the FlashTool.
7. The preloader will initialize the DRAM, download data via USB and
write it to flash.
So the preloader is not only a simple SPL. It initializes DRAM and many
other components which will only be initialized once or used by
preloader. It also performs USB downloading and other things.
The preloader is also used by other MediaTek's smart phone SoCs. The
DRAM initialization code is the mainly part that are not allowed to be
open-sourced.
The preloader has so many functions which are not easy to port to the
U-Boot SPL.
Assume all the codes are allowed to be open sourced.If all the functions
are ported to SPL, the DM must be used in SPL, which will make the SPL
binary too large to fit in the SRAM.If only the necessary parts are
ported (e.g. DRAM initialization), the SPL will be incompatible with the
BootROM and the FlashTool and the users will be in trouble recovering a
board.
At present the preloader can be downloaded from the Internet. Users can
concentrate on the development without managing the low level parts.
BTW, there are also chips use U-Boot as a second/third bootloader while
using their proprietary binary as the first stage bootloader. For
example the bcm7xxx.
BRs,
Weijie
next prev parent reply other threads:[~2018-11-19 7:15 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 2:07 [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629 Ryder Lee
2018-11-15 2:07 ` [U-Boot] [PATCH v5 01/18] tools: MediaTek: add MTK boot header generation to mkimage Ryder Lee
2018-11-27 3:12 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-27 4:51 ` Ryder Lee
2018-11-29 14:20 ` Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 02/18] arm: dts: MediaTek: add device tree for MT7629 Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 03/18] arm: dts: MediaTek: add device tree for MT7623 Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 04/18] arm: MediaTek: add basic support for MT7629 boards Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 05/18] arm: MediaTek: add basic support for MT7623 boards Ryder Lee
2018-11-15 19:21 ` Simon Glass
2018-11-16 7:08 ` Weijie Gao
2018-11-16 18:26 ` Simon Glass
2018-11-19 7:15 ` Weijie Gao [this message]
2018-11-19 17:14 ` Simon Glass
2018-11-20 6:35 ` Weijie Gao
2018-11-27 1:02 ` Simon Glass
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 06/18] clk: MediaTek: add clock driver for MT7629 SoC Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 07/18] clk: MediaTek: add clock driver for MT7623 SoC Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 08/18] timer: MediaTek: add timer driver for MediaTek SoCs Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 09/18] watchdog: MediaTek: add watchdog " Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 10/18] pinctrl: MediaTek: add pinctrl driver for MT7629 SoC Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:07 ` [U-Boot] [PATCH v5 11/18] pinctrl: MediaTek: add pinctrl driver for MT7623 SoC Ryder Lee
2018-11-29 14:20 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 12/18] power domain: MediaTek: add power domain driver for MT7629 SoC Ryder Lee
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 13/18] power domain: MediaTek: add power domain driver for MT7623 SoC Ryder Lee
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 14/18] serial: MediaTek: add high-speed uart driver for MediaTek SoCs Ryder Lee
2018-11-15 19:21 ` Simon Glass
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 15/18] ram: MediaTek: add DDR3 driver for MT7629 SoC Ryder Lee
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 16/18] mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC Ryder Lee
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 17/18] doc: README.mediatek: Add a simple README for MediaTek Ryder Lee
2018-11-15 19:21 ` Simon Glass
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-15 2:08 ` [U-Boot] [PATCH v5 18/18] MAINTAINERS: add an entry " Ryder Lee
2018-11-29 14:21 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-11-17 9:37 ` [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629 Frank Wunderlich
2018-11-17 10:20 ` Frank Wunderlich
2018-11-17 11:23 ` Frank Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1542611759.18546.65.camel@mcddlt001 \
--to=weijie.gao@mediatek.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox