diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-06-20 19:46:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 19:46:38 +0300 |
commit | 43a183cc0926da36e3a218efa02ab4838ace316f (patch) | |
tree | 9ea192b408585fc2a19b54d196c3d56eaddc4acb /meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch | |
parent | 5575b1d27fc222f973d96dc06af0f21ba7656f28 (diff) | |
parent | 2c7e8f4ce61f2e0407c37e98e22bbb13e562b414 (diff) | |
download | openbmc-43a183cc0926da36e3a218efa02ab4838ace316f.tar.xz |
Merge pull request #12 from Intel-BMC/update
Update
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch index d5d43f31b..94722d6c4 100644 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0053-Add-Aspeed-SoC-24xx-and-25xx-families-JTAG.patch @@ -1,6 +1,6 @@ From 817a43d1b1e197e7eff43492599469bbc23bf0fd Mon Sep 17 00:00:00 2001 From: "Corona, Ernesto" <ernesto.corona@intel.com> -Date: Fri, 17 May 2019 11:18:13 -0800 +Date: Mon, 3 Jun 2019 08:22:09 -0800 Subject: [PATCH v29 2/6] Add Aspeed SoC 24xx and 25xx families JTAG master driver @@ -46,6 +46,8 @@ Comments pointed by Steven Filary <steven.a.filary@intel.com> (master/slave). - Encansulate dev_dgb message into DEBUG_JTAG macros to improve driver's JTAG performace. +- Add support for multichain. Set tap state and xfer operations now include + two tap state arguments: current state and end state. v27->v28 Comments pointed by Steven Filary <steven.a.filary@intel.com> @@ -198,8 +200,8 @@ Comments pointed by kbuild test robot <lkp@intel.com> --- drivers/jtag/Kconfig | 14 + drivers/jtag/Makefile | 1 + - drivers/jtag/jtag-aspeed.c | 1040 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 1055 insertions(+) + drivers/jtag/jtag-aspeed.c | 1050 ++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 1065 insertions(+) create mode 100644 drivers/jtag/jtag-aspeed.c diff --git a/drivers/jtag/Kconfig b/drivers/jtag/Kconfig @@ -236,7 +238,7 @@ new file mode 100644 index 0000000..1d41a66 --- /dev/null +++ b/drivers/jtag/jtag-aspeed.c -@@ -0,0 +1,1040 @@ +@@ -0,0 +1,1050 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2018 Mellanox Technologies. All rights reserved. +// Copyright (c) 2018 Oleksandr Shamray <oleksandrs@mellanox.com> @@ -327,6 +329,7 @@ index 0000000..1d41a66 +#define WAIT_ITERATIONS 75 + +/*#define USE_INTERRUPTS*/ ++/*#define DEBUG_JTAG*/ + +static const char * const regnames[] = { + [ASPEED_JTAG_DATA] = "ASPEED_JTAG_DATA", @@ -344,7 +347,7 @@ index 0000000..1d41a66 + void __iomem *reg_base; + struct device *dev; + struct clk *pclk; -+ enum jtag_endstate status; ++ enum jtag_tapstate status; + int irq; + struct reset_control *rst; + u32 flag; @@ -480,10 +483,12 @@ index 0000000..1d41a66 + {0x0b, 4}, {0x0b, 5}, {0x2b, 6}, {0x00, 0} }, +}; + ++#ifdef DEBUG_JTAG +static char *end_status_str[] = { + "tlr", "idle", "selDR", "capDR", "sDR", "ex1DR", "pDR", "ex2DR", + "updDR", "selIR", "capIR", "sIR", "ex1IR", "pIR", "ex2IR", "updIR" +}; ++#endif + +static u32 aspeed_jtag_read(struct aspeed_jtag *aspeed_jtag, u32 reg) +{ @@ -776,24 +781,29 @@ index 0000000..1d41a66 +} + +static void aspeed_jtag_set_tap_state(struct aspeed_jtag *aspeed_jtag, -+ enum jtag_endstate endstate) ++ enum jtag_tapstate from_state, ++ enum jtag_tapstate end_state) +{ + int i = 0; -+ enum jtag_endstate from, to; ++ enum jtag_tapstate from, to; ++ ++ from = from_state; ++ to = end_state; ++ ++ if (from == JTAG_STATE_CURRENT) ++ from = aspeed_jtag->status; + -+ from = aspeed_jtag->status; -+ to = endstate; + for (i = 0; i < _tms_cycle_lookup[from][to].count; i++) + aspeed_jtag_tck_cycle(aspeed_jtag, + ((_tms_cycle_lookup[from][to].tmsbits >> i) & 0x1), 0); -+ aspeed_jtag->status = endstate; ++ aspeed_jtag->status = end_state; +} + -+static void aspeed_jtag_end_tap_state_sw(struct aspeed_jtag *aspeed_jtag, -+ struct jtag_end_tap_state *endstate) ++static void aspeed_jtag_set_tap_state_sw(struct aspeed_jtag *aspeed_jtag, ++ struct jtag_tap_state *tapstate) +{ + /* SW mode from curent tap state -> to end_state */ -+ if (endstate->reset) { ++ if (tapstate->reset) { + int i = 0; + + for (i = 0; i < ASPEED_JTAG_RESET_CNTR; i++) @@ -801,26 +811,27 @@ index 0000000..1d41a66 + aspeed_jtag->status = JTAG_STATE_TLRESET; + } + -+ aspeed_jtag_set_tap_state(aspeed_jtag, endstate->endstate); ++ aspeed_jtag_set_tap_state(aspeed_jtag, tapstate->from, ++ tapstate->endstate); +} + +static int aspeed_jtag_status_set(struct jtag *jtag, -+ struct jtag_end_tap_state *endstate) ++ struct jtag_tap_state *tapstate) +{ + struct aspeed_jtag *aspeed_jtag = jtag_priv(jtag); + +#ifdef DEBUG_JTAG + dev_dbg(aspeed_jtag->dev, "Set TAP state: %s\n", -+ end_status_str[endstate->endstate]); ++ end_status_str[tapstate->endstate]); +#endif + + if (!(aspeed_jtag->mode & JTAG_XFER_HW_MODE)) { -+ aspeed_jtag_end_tap_state_sw(aspeed_jtag, endstate); ++ aspeed_jtag_set_tap_state_sw(aspeed_jtag, tapstate); + return 0; + } + + /* x TMS high + 1 TMS low */ -+ if (endstate->reset) { ++ if (tapstate->reset) { + /* Disable sw mode */ + aspeed_jtag_write(aspeed_jtag, 0, ASPEED_JTAG_SW); + mdelay(1); @@ -851,9 +862,11 @@ index 0000000..1d41a66 +#endif + + if (xfer->type == JTAG_SIR_XFER) -+ aspeed_jtag_set_tap_state(aspeed_jtag, JTAG_STATE_SHIFTIR); ++ aspeed_jtag_set_tap_state(aspeed_jtag, xfer->from, ++ JTAG_STATE_SHIFTIR); + else -+ aspeed_jtag_set_tap_state(aspeed_jtag, JTAG_STATE_SHIFTDR); ++ aspeed_jtag_set_tap_state(aspeed_jtag, xfer->from, ++ JTAG_STATE_SHIFTDR); + + tdi = ASPEED_JTAG_GET_TDI(xfer->direction, data[index]); + data[index] = 0; @@ -889,7 +902,8 @@ index 0000000..1d41a66 + ASPEED_JTAG_DATA_CHUNK_SIZE); + aspeed_jtag->status = (xfer->type == JTAG_SIR_XFER) ? + JTAG_STATE_EXIT1IR : JTAG_STATE_EXIT1DR; -+ aspeed_jtag_set_tap_state(aspeed_jtag, xfer->endstate); ++ aspeed_jtag_set_tap_state(aspeed_jtag, aspeed_jtag->status, ++ xfer->endstate); + } +} + @@ -916,8 +930,7 @@ index 0000000..1d41a66 + +static int aspeed_jtag_xfer_push_data_last(struct aspeed_jtag *aspeed_jtag, + enum jtag_xfer_type type, -+ u32 shift_bits, -+ enum jtag_endstate endstate) ++ u32 shift_bits) +{ + int res = 0; + @@ -1014,8 +1027,7 @@ index 0000000..1d41a66 + if (aspeed_jtag_xfer_push_data_last( + aspeed_jtag, + xfer->type, -+ shift_bits, -+ xfer->endstate) != 0) { ++ shift_bits) != 0) { + return -EFAULT; + } + } else { |