From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7] socfpga: Adding Scan Manager driver
Date: Mon, 24 Mar 2014 10:25:03 -0500 [thread overview]
Message-ID: <1395674703.2268.10.camel@clsee-VirtualBox.altera.com> (raw)
In-Reply-To: <532075C8.70205@monstr.eu>
Hi Michal,
On Wed, 2014-03-12 at 15:57 +0100, Michal Simek wrote:
> On 03/05/2014 05:05 PM, Chin Liang See wrote:
> > Scan Manager driver will be called to configure the IOCSR
> > scan chain. This configuration will setup the IO buffer settings
> >
> > Signed-off-by: Chin Liang See <clsee@altera.com>
> > Cc: Dinh Nguyen <dinguyen@altera.com>
> > Cc: Wolfgang Denk <wd@denx.de>
> > CC: Pavel Machek <pavel@denx.de>
> > Cc: Tom Rini <trini@ti.com>
> > Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> > ---
> > Changes for v7
> > - Enhance the function scan_chain_engine_is_idle
> > Changes for v6
> > - Fixed various coding style issue
> > Changes for v5
> > - Removal of additional blank line
> > - Added comment for magic number
> > Changes for v4
> > - avoid code duplication by add goto error
> > - include underscore to variables name
> > Changes for v3
> > - merge the handoff file and driver into single patch
> > Changes for v2
> > - rebase with latest v2014.01-rc1
> > ---
> > arch/arm/cpu/armv7/socfpga/Makefile | 2 +-
> > arch/arm/cpu/armv7/socfpga/scan_manager.c | 209 +++++++
> > arch/arm/cpu/armv7/socfpga/spl.c | 4 +
> > arch/arm/include/asm/arch-socfpga/scan_manager.h | 90 +++
> > .../include/asm/arch-socfpga/socfpga_base_addrs.h | 1 +
> > board/altera/socfpga/iocsr_config.c | 657 ++++++++++++++++++++
> > board/altera/socfpga/iocsr_config.h | 17 +
> > include/configs/socfpga_cyclone5.h | 1 +
> > 8 files changed, 980 insertions(+), 1 deletion(-)
> > create mode 100644 arch/arm/cpu/armv7/socfpga/scan_manager.c
> > create mode 100644 arch/arm/include/asm/arch-socfpga/scan_manager.h
> > create mode 100644 board/altera/socfpga/iocsr_config.c
> > create mode 100644 board/altera/socfpga/iocsr_config.h
> >
> > + /*
> > + * Program the last part of IO scan chain write TDI_TDO packet
> > + * header (2 bytes) to scan manager
> > + */
> > + writel(tdi_tdo_header, &scan_manager_base->fifo_double_byte);
> > +
> > + for (i = 0; i < io_program_iter; i++) {
> > + /*
> > + * write remaining scan chain data into scan
> > + * manager WFIFO with 4 bytes write
> > + */
>
> Wrong indentation here.
Just a small cosmetic error. I would just leave it as of now.
>
>
> > + writel(iocsr_scan_chain[index + i],
> > + &scan_manager_base->fifo_quad_byte);
> > + }
> > +
> > + index += io_program_iter;
> > + residual = io_scan_chain_data_residual &
> > + IO_SCAN_CHAIN_32BIT_MASK;
> > +
> > + if (IO_SCAN_CHAIN_PAYLOAD_24BIT < residual) {
> > + /*
> > + * write the last 4B scan chain data
> > + * into scan manager WFIFO
> > + */
> > + writel(iocsr_scan_chain[index],
> > + &scan_manager_base->fifo_quad_byte);
> > + } else {
> > + /*
> > + * write the remaining 1 - 3 bytes scan chain
> > + * data into scan manager WFIFO byte by byte
> > + * to prevent JTAG engine shifting unused data
> > + * from the FIFO and mistaken the data as a
> > + * valid command (even though unused bits are
> > + * set to 0, but just to prevent hardware
> > + * glitch)
> > + */
> > + for (i = 0; i < residual; i += 8) {
> > + writel(((iocsr_scan_chain[index] >> i)
> > + & IO_SCAN_CHAIN_BYTE_MASK),
> > + &scan_manager_base->fifo_single_byte);
> > + }
> > + }
> > +
> > + /*
> > + * Check if the scan chain engine has completed the
> > + * IO scan chain data shifting
> > + */
> > + if (!scan_chain_engine_is_idle(SCAN_MAX_DELAY))
> > + goto error;
> > + }
> > +
> > + /* Disable IO Scan chain when configuration done*/
>
> <space>*/ here.
same as above.
Thanks
Chin Liang
>
> Thanks,
> Michal
>
prev parent reply other threads:[~2014-03-24 15:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 16:05 [U-Boot] [PATCH v7] socfpga: Adding Scan Manager driver Chin Liang See
2014-03-12 14:45 ` Chin Liang See
2014-03-12 14:54 ` Michal Simek
2014-03-24 15:21 ` Chin Liang See
2014-03-25 6:20 ` Michal Simek
2014-04-01 8:46 ` Pavel Machek
2014-04-01 9:07 ` Michal Simek
2014-04-01 11:17 ` Steffen Trumtrar
2014-04-03 9:35 ` Pavel Machek
2014-04-03 10:05 ` Michal Simek
2014-03-12 14:57 ` Michal Simek
2014-03-24 15:25 ` Chin Liang See [this message]
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=1395674703.2268.10.camel@clsee-VirtualBox.altera.com \
--to=clsee@altera.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