Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 425779f84e50
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 595765f41a86
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Nov 19, 2018

  1. arch.jtag: fix typo.

    whitequark committed Nov 19, 2018
    Copy the full SHA
    805144e View commit details
  2. Copy the full SHA
    e1cc6d4 View commit details
  3. Copy the full SHA
    595765f View commit details
2 changes: 1 addition & 1 deletion software/glasgow/applet/__init__.py
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ def wrapper(self):
from .i2c.tps6598x import I2CTPS6598xApplet
from .jtag import JTAGApplet
from .jtag.arc import JTAGARCApplet
from .jtag.mec1618 import JTAGMEC1618Applet
from .jtag.mec16xx import JTAGMEC16xxApplet
from .jtag.mips import JTAGMIPSApplet
from .jtag.pinout import JTAGPinoutApplet
from .jtag.svf import JTAGSVFApplet
10 changes: 7 additions & 3 deletions software/glasgow/applet/jtag/arc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Ref: ARC® 700 External Interfaces Reference
# Document Number: 5117-014
# Ref: Microchip MEC1618/MEC1618i Low Power 32-bit Microcontroller with Embedded Flash
# Document Number: DS00002339A
# Ref: Microchip MEC1609 Mixed Signal Mobile Embedded Flash ARC EC BC-Link/VLPC Base Component
# Document Number: DS00002485A

import logging
import argparse
@@ -25,9 +29,9 @@ async def identify(self):
await self.lower.write_ir(IR_IDCODE)
idcode_bits = await self.lower.read_dr(32)
idcode = DR_IDCODE.from_bitarray(idcode_bits)
self._log("read IDCODE mfg_id=%03x part_id=%04x",
idcode.mfg_id, idcode.part_id)
device = devices[idcode.mfg_id, idcode.part_id]
self._log("read IDCODE mfg_id=%03x arc_type=%02x arc_number=%03x",
idcode.mfg_id, idcode.part_id & 0b111111, idcode.part_id >> 6)
device = devices[idcode.mfg_id, idcode.part_id & 0b111111]
return idcode, device

async def _wait_txn(self):
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Ref: Microchip MEC1618/MEC1618i Low Power 32-bit Microcontroller with Embedded Flash
# Ref: Microchip MEC1618 Low Power 32-bit Microcontroller with Embedded Flash
# Document Number: DS00002339A
# Ref: Microchip MEC1609 Mixed Signal Mobile Embedded Flash ARC EC BC-Link/VLPC Base Component
# Document Number: DS00002485A

import logging
import argparse
@@ -15,7 +17,7 @@
FIRMWARE_SIZE = 0x30_000


class JTAGMEC1618Interface(aobject):
class JTAGMEC16xxInterface(aobject):
async def __init__(self, interface, logger):
self.lower = interface
self._logger = logger
@@ -30,7 +32,7 @@ async def __init__(self, interface, logger):
await self.lower.set_halted(True)

def _log(self, message, *args):
self._logger.log(self._level, "MEC1618: " + message, *args)
self._logger.log(self._level, "MEC16xx: " + message, *args)

async def read_firmware(self):
words = []
@@ -40,17 +42,17 @@ async def read_firmware(self):
return words


class JTAGMEC1618Applet(JTAGARCApplet, name="jtag-mec1618"):
class JTAGMEC16xxApplet(JTAGARCApplet, name="jtag-mec16xx"):
preview = True
logger = logging.getLogger(__name__)
help = "debug Microchip MEC1618 embedded controller via JTAG"
help = "debug Microchip MEC16xx embedded controller via JTAG"
description = """
Debug Microchip MEC1618/MEC1618i embedded controller via the JTAG interface.
Debug Microchip MEC16xx/MEC16xxi embedded controller via the JTAG interface.
"""

async def run(self, device, args):
arc_iface = await super().run(device, args)
return await JTAGMEC1618Interface(arc_iface, self.logger)
return await JTAGMEC16xxInterface(arc_iface, self.logger)

@classmethod
def add_interact_arguments(cls, parser):
4 changes: 2 additions & 2 deletions software/glasgow/arch/arc/jtag.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ref: Microchip MEC1618/MEC1618i Low Power 32-bit Microcontroller with Embedded Flash
# Document Number: DS00002339A
# Ref: ARC® 700 External Interfaces Reference
# Document Number: 5117-014

from bitarray import bitarray

2 changes: 1 addition & 1 deletion software/glasgow/arch/jtag.py
Original file line number Diff line number Diff line change
@@ -15,5 +15,5 @@
("present", 1),
("mfg_id", 11),
("part_id", 16),
("version", 8),
("version", 4),
])
1 change: 1 addition & 0 deletions software/glasgow/database/arc.py
Original file line number Diff line number Diff line change
@@ -9,4 +9,5 @@

devices = defaultdict(lambda: None, {
(0x258, 0x0002): ARCDevice(name="ARC6xx"),
(0x258, 0x0003): ARCDevice(name="ARC7xx"),
})