From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chee, Tien Fong Date: Wed, 9 Aug 2017 05:07:01 +0000 Subject: [U-Boot] [PATCH v2 2/5] arm: socfpga: Add checking function on FPGA setting in FDT In-Reply-To: References: <1502183569-7902-1-git-send-email-tien.fong.chee@intel.com> <1502183569-7902-3-git-send-email-tien.fong.chee@intel.com> Message-ID: <1502255220.2162.16.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Sel, 2017-08-08 at 11:29 +0200, Marek Vasut wrote: > On 08/08/2017 11:12 AM, tien.fong.chee at intel.com wrote: > > > > From: Tien Fong Chee > > > > Function for checking FPGA early release setting which is defined > > by user in FDT chosen section. This function would be used by > > later driver in decision applying appropriate FPGA configuration in > > early release or full FPGA booting mode. > Isn't this a property of the FPGA driver ? > Shouldn't this have altr, prefix ? > Did this go through DT binding review? > This is our own define under chosen section. This is flag to tell U- boot what kind of boot and what kind of fpga configuration we want during boot. > > > > Signed-off-by: Tien Fong Chee > > --- > >  arch/arm/mach-socfpga/include/mach/misc.h |  1 + > >  arch/arm/mach-socfpga/misc_arria10.c      | 20 > > ++++++++++++++++++++ > >  2 files changed, 21 insertions(+) > > > > diff --git a/arch/arm/mach-socfpga/include/mach/misc.h > > b/arch/arm/mach-socfpga/include/mach/misc.h > > index 0b65783..e003f8a 100644 > > --- a/arch/arm/mach-socfpga/include/mach/misc.h > > +++ b/arch/arm/mach-socfpga/include/mach/misc.h > > @@ -26,6 +26,7 @@ static inline void socfpga_fpga_add(void) {} > >  unsigned int dedicated_uart_com_port(const void *blob); > >  unsigned int shared_uart_com_port(const void *blob); > >  unsigned int uart_com_port(const void *blob); > > +int is_early_release_fpga_config(const void *blob); > >  #endif > >   > >  #endif /* _MISC_H_ */ > > diff --git a/arch/arm/mach-socfpga/misc_arria10.c b/arch/arm/mach- > > socfpga/misc_arria10.c > > index 9d751f6..2d6e977 100644 > > --- a/arch/arm/mach-socfpga/misc_arria10.c > > +++ b/arch/arm/mach-socfpga/misc_arria10.c > > @@ -235,6 +235,26 @@ unsigned int uart_com_port(const void *blob) > >   return shared_uart_com_port(blob); > >  } > >   > > +int is_chosen_boolean_true(const void *blob, const char *name) > > +{ > > + int node; > > + int rval = 0; > > + > > + node = fdt_subnode_offset(blob, 0, "chosen"); > > + > > + if (node >= 0) > > + rval = fdtdec_get_bool(blob, node, name); > > + > > + return rval; > > +} > > + > > +int is_early_release_fpga_config(const void *blob) > > +{ > > + static const char *name = "early-release-fpga-config"; > > + > > + return is_chosen_boolean_true(blob, name); > > +} > > + > >  /* > >   * Print CPU information > >   */ > > >