From: Chee, Tien Fong <tien.fong.chee@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] spl : socfpga: Implement fpga bitstream loading with socfpga loadfs
Date: Tue, 1 Jan 2019 03:39:11 +0000 [thread overview]
Message-ID: <1546313950.10462.32.camel@intel.com> (raw)
In-Reply-To: <1d8a83e1-14c8-cd36-0f3b-59ceffe38fe3@denx.de>
On Sun, 2018-12-30 at 16:51 +0100, Marek Vasut wrote:
> On 12/30/18 9:13 AM, tien.fong.chee at intel.com wrote:
> >
> > From: Tien Fong Chee <tien.fong.chee@intel.com>
> >
> > Add support for loading FPGA bitstream to get DDR up running before
> > U-Boot is loaded into DDR. Boot device initialization, generic
> > firmware
> > loader and SPL FAT support are required for this whole mechanism to
> > work.
> >
> > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > ---
> > arch/arm/mach-socfpga/spl_a10.c | 46
> > ++++++++++++++++++++++++++++++++++++++-
> > 1 files changed, 45 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-
> > socfpga/spl_a10.c
> > index 3ea64f7..93f5f46 100644
> > --- a/arch/arm/mach-socfpga/spl_a10.c
> > +++ b/arch/arm/mach-socfpga/spl_a10.c
> > @@ -1,6 +1,6 @@
> > // SPDX-License-Identifier: GPL-2.0+
> > /*
> > - * Copyright (C) 2012 Altera Corporation <www.altera.com>
> > + * Copyright (C) 2012-2018 Altera Corporation <www.altera.com>
> > */
> >
> > #include <common.h>
> > @@ -23,9 +23,14 @@
> > #include <fdtdec.h>
> > #include <watchdog.h>
> > #include <asm/arch/pinmux.h>
> > +#include <asm/arch/fpga_manager.h>
> > +#include <mmc.h>
> >
> > DECLARE_GLOBAL_DATA_PTR;
> >
> > +#define FPGA_SOCFGA_A10_RBF_CORE_LOAD_DDR (1 * 1024)
> > +#define FPGA_SOCFGA_A10_RBF_CORE_BUFFER_SIZE (40 * 1024 *
> > 1024)
> > +
> > static const struct socfpga_system_manager *sysmgr_regs =
> > (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
> >
> > @@ -73,6 +78,45 @@ void spl_board_init(void)
> > WATCHDOG_RESET();
> >
> > arch_early_init_r();
> > +
> > + /* If the full FPGA is already loaded, ie.from EPCQ,
> > config fpga pins */
> > + if (is_fpgamgr_user_mode()) {
> > + config_pins(gd->fdt_blob, "shared");
> > + config_pins(gd->fdt_blob, "fpga");
> What happens if config_pins() fails ? The function returns some
> return
> value.
There is return value for config_pins, i can add the debug print out
for the return value.
>
> >
> > + } else if (!is_fpgamgr_early_user_mode()) {
> > + /* Program IOSSM(early IO release) or full FPGA */
> > + fpga_fs_info fpga_fsinfo;
> > + int len;
> > + char buf[16 * 1024] __aligned(ARCH_DMA_MINALIGN);
> > +
> > + fpga_fsinfo.filename = (char *)get_fpga_filename(
> Is the cast needed ?
there is a warning
arch/arm/mach-socfpga/spl_a10.c:109:24: warning: assignment discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
fpga_fsinfo.filename = get_fpga_filename(
>
> >
> > + gd->fdt_blob,
> > + &len,
> > + FPGA_SOCFPGA_A10_R
> > BF_PERIPH);
> > +
> > + if (fpga_fsinfo.filename)
> > + socfpga_loadfs(&fpga_fsinfo, buf,
> > sizeof(buf), 0);
> > + }
> > +
> > + /* If the IOSSM/full FPGA is already loaded, start DDR */
> > + if (is_fpgamgr_early_user_mode() ||
> > is_fpgamgr_user_mode())
> > + ddr_calibration_sequence();
> > +
> > + if (!is_fpgamgr_user_mode()) {
> > + fpga_fs_info fpga_fsinfo;
> > + int len;
> > +
> > + fpga_fsinfo.filename = (char *)get_fpga_filename(
> > + gd->fdt_blob,
> > + &len,
> > + FPGA_SOCFPGA_A10_R
> > BF_CORE);
> > +
> > + if (fpga_fsinfo.filename)
> > + socfpga_loadfs(&fpga_fsinfo,
> > + (const void
> > *)FPGA_SOCFGA_A10_RBF_CORE_LOAD_DDR,
> > + (size_t)FPGA_SOCFGA_A10_RBF_CORE_B
> > UFFER_SIZE,
> > + 0);
> > + }
> > }
> >
> > void board_init_f(ulong dummy)
> >
>
next prev parent reply other threads:[~2019-01-01 3:39 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-30 8:13 [U-Boot] [PATCH 0/6] Add support for loading FPGA bitstream tien.fong.chee at intel.com
2018-12-30 8:13 ` [U-Boot] [PATCH 1/6] ARM: socfpga: Description on FPGA bitstream type and file name for Arria 10 tien.fong.chee at intel.com
2018-12-30 15:46 ` Marek Vasut
2019-01-01 3:10 ` Chee, Tien Fong
2019-01-01 20:27 ` Marek Vasut
2019-01-03 5:07 ` Chee, Tien Fong
2019-01-03 5:27 ` Marek Vasut
2019-01-03 5:41 ` Chee, Tien Fong
2019-01-03 7:28 ` Chee, Tien Fong
2019-01-03 20:14 ` Marek Vasut
2019-01-04 0:46 ` Chee, Tien Fong
2019-01-04 2:10 ` Marek Vasut
2019-01-04 2:22 ` Chee, Tien Fong
2019-01-04 2:24 ` Marek Vasut
2019-01-04 3:10 ` Chee, Tien Fong
2018-12-30 8:13 ` [U-Boot] [PATCH 2/6] ARM: socfpga: Add FPGA drivers for Arria 10 FPGA bitstream loading tien.fong.chee at intel.com
2018-12-30 15:45 ` Marek Vasut
2019-01-01 3:28 ` Chee, Tien Fong
2019-01-01 20:27 ` Marek Vasut
2019-01-03 4:51 ` Chee, Tien Fong
2018-12-30 8:13 ` [U-Boot] [PATCH 3/6] ARM: socfpga: Add the configuration for FPGA SoCFPGA A10 SoCDK tien.fong.chee at intel.com
2018-12-30 15:47 ` Marek Vasut
2019-01-01 3:32 ` Chee, Tien Fong
2019-01-01 20:29 ` Marek Vasut
2019-01-03 5:36 ` Chee, Tien Fong
2019-01-03 20:15 ` Marek Vasut
2019-01-04 0:40 ` Chee, Tien Fong
2019-01-15 8:16 ` Chee, Tien Fong
2019-01-15 11:34 ` Marek Vasut
2018-12-30 8:13 ` [U-Boot] [PATCH 4/6] ARM: dts: socfpga: Add missing SDMMC reset tien.fong.chee at intel.com
2018-12-30 15:48 ` Marek Vasut
2018-12-30 8:13 ` [U-Boot] [PATCH 5/6] spl : socfpga: Implement fpga bitstream loading with socfpga loadfs tien.fong.chee at intel.com
2018-12-30 15:51 ` Marek Vasut
2019-01-01 3:39 ` Chee, Tien Fong [this message]
2019-01-01 20:31 ` Marek Vasut
2019-01-03 5:32 ` Chee, Tien Fong
2018-12-30 8:13 ` [U-Boot] [PATCH 6/6] ARM: socfpga: Synchronize the configuration for A10 SoCDK tien.fong.chee at intel.com
2018-12-30 15:54 ` Marek Vasut
2019-01-01 3:51 ` Chee, Tien Fong
2019-01-01 20:35 ` Marek Vasut
2019-01-02 8:50 ` Chee, Tien Fong
2019-01-02 14:20 ` Marek Vasut
2018-12-30 15:44 ` [U-Boot] [PATCH 0/6] Add support for loading FPGA bitstream Marek Vasut
2019-01-01 2:52 ` Chee, Tien Fong
2019-01-01 20:36 ` Marek Vasut
2019-01-03 5:33 ` Chee, Tien Fong
2019-01-03 20:16 ` Marek Vasut
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=1546313950.10462.32.camel@intel.com \
--to=tien.fong.chee@intel.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