savePower = power;
if (power)
{
savePower = power;
if (power)
{
- HAL_WRITE_UINT32(0x08000014, 0x8);
+ HAL_WRITE_UINT32(ZY1000_JTAG_BASE+0x14, 0x8);
- HAL_WRITE_UINT32(0x08000010, 0x8);
+ HAL_WRITE_UINT32(ZY1000_JTAG_BASE+0x10, 0x8);
static char forwardBuffer[1024]; // NB! must be smaller than a TCP/IP packet!!!!!
static char backwardBuffer[1024];
static char forwardBuffer[1024]; // NB! must be smaller than a TCP/IP packet!!!!!
static char backwardBuffer[1024];
-static cyg_io_handle_t serial_handle;
void setNoDelay(int session, int flag)
{
void setNoDelay(int session, int flag)
{
//get existing serial configuration
len = sizeof(cyg_serial_info_t);
int err;
//get existing serial configuration
len = sizeof(cyg_serial_info_t);
int err;
+ cyg_io_handle_t serial_handle;
+
+ err = cyg_io_lookup("/dev/ser0", &serial_handle);
+ if (err != ENOERR)
+ {
+ LOG_ERROR("/dev/ser0 not found\n");
+ return ERROR_FAIL;
+ }
+
+
err = cyg_io_get_config(serial_handle, CYG_IO_GET_CONFIG_SERIAL_OUTPUT_DRAIN, &buf, &len);
err = cyg_io_get_config(serial_handle, CYG_IO_GET_CONFIG_SERIAL_INFO, &buf, &len);
if (err != ENOERR)
err = cyg_io_get_config(serial_handle, CYG_IO_GET_CONFIG_SERIAL_OUTPUT_DRAIN, &buf, &len);
err = cyg_io_get_config(serial_handle, CYG_IO_GET_CONFIG_SERIAL_INFO, &buf, &len);
if (err != ENOERR)
ramblockdevice=(cyg_uint8 *)malloc(ramblockdevice_size);
memset(ramblockdevice, 0xff, ramblockdevice_size);
ramblockdevice=(cyg_uint8 *)malloc(ramblockdevice_size);
memset(ramblockdevice, 0xff, ramblockdevice_size);
#ifdef CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION
setHandler(CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION);
setHandler(CYGNUM_HAL_VECTOR_ABORT_PREFETCH);
#ifdef CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION
setHandler(CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION);
setHandler(CYGNUM_HAL_VECTOR_ABORT_PREFETCH);
- err = cyg_io_lookup("/dev/ser0", &serial_handle);
- if (err != ENOERR)
- {
- diag_printf("/dev/ser0 not found\n");
- reboot();
- }
setPower(true); // on by default
setPower(true); // on by default
err = mount("/dev/flash1", "/config", "jffs2");
if (err < 0)
{
err = mount("/dev/flash1", "/config", "jffs2");
if (err < 0)
{
- diag_printf("unable to mount jffs\n");
- reboot();
- }
-
- /* are we using a ram disk instead of a flash disk? This is used
- * for ZY1000 live demo...
- *
- * copy over flash disk to ram block device
- */
- if (boolParam("ramdisk"))
- {
- diag_printf("Unmounting /config from flash and using ram instead\n");
- err=umount("/config");
- if (err < 0)
+ diag_printf("unable to mount jffs2, falling back to ram disk..\n");
+ err = mount("", "/config", "ramfs");
+ if (err<0)
- diag_printf("unable to unmount jffs\n");
+ diag_printf("unable to mount /config as ramdisk.\n");
-
- err = mount("/dev/flash1", "/config2", "jffs2");
- if (err < 0)
+ } else
+ {
+ /* are we using a ram disk instead of a flash disk? This is used
+ * for ZY1000 live demo...
+ *
+ * copy over flash disk to ram block device
+ */
+ if (boolParam("ramdisk"))
- diag_printf("unable to mount jffs\n");
- reboot();
- }
+ diag_printf("Unmounting /config from flash and using ram instead\n");
+ err=umount("/config");
+ if (err < 0)
+ {
+ diag_printf("unable to unmount jffs\n");
+ reboot();
+ }
- err = mount("/dev/ram", "/config", "jffs2");
- if (err < 0)
- {
- diag_printf("unable to mount ram block device\n");
- reboot();
- }
+ err = mount("/dev/flash1", "/config2", "jffs2");
+ if (err < 0)
+ {
+ diag_printf("unable to mount jffs\n");
+ reboot();
+ }
-// copydir("/config2", "/config");
- copyfile("/config2/ip", "/config/ip");
- copydir("/config2/settings", "/config/settings");
+ err = mount("/dev/ram", "/config", "jffs2");
+ if (err < 0)
+ {
+ diag_printf("unable to mount ram block device\n");
+ reboot();
+ }
- umount("/config2");
- } else
- {
- /* we're not going to use a ram block disk */
- free(ramblockdevice);
+ // copydir("/config2", "/config");
+ copyfile("/config2/ip", "/config/ip");
+ copydir("/config2/settings", "/config/settings");
+
+ umount("/config2");
+ } else
+ {
+ /* we're not going to use a ram block disk */
+ free(ramblockdevice);
+ }
{
cyg_uint32 state;
// sample and clear power dropout
{
cyg_uint32 state;
// sample and clear power dropout
- HAL_WRITE_UINT32(0x08000010, 0x80);
- HAL_READ_UINT32(0x08000010, state);
+ HAL_WRITE_UINT32(ZY1000_JTAG_BASE+0x10, 0x80);
+ HAL_READ_UINT32(ZY1000_JTAG_BASE+0x10, state);
bool powerDropout;
powerDropout = (state & 0x80) != 0;
return powerDropout;
bool powerDropout;
powerDropout = (state & 0x80) != 0;
return powerDropout;
{
cyg_uint32 state;
// sample and clear SRST sensing
{
cyg_uint32 state;
// sample and clear SRST sensing
- HAL_WRITE_UINT32(0x08000010, 0x00000040);
- HAL_READ_UINT32(0x08000010, state);
+ HAL_WRITE_UINT32(ZY1000_JTAG_BASE+0x10, 0x00000040);
+ HAL_READ_UINT32(ZY1000_JTAG_BASE+0x10, state);
bool srstAsserted;
srstAsserted = (state & 0x40) != 0;
return srstAsserted;
bool srstAsserted;
srstAsserted = (state & 0x40) != 0;
return srstAsserted;
LOG_DEBUG("zy1000 trst=%d, srst=%d", trst, srst);
if(!srst)
{
LOG_DEBUG("zy1000 trst=%d, srst=%d", trst, srst);
if(!srst)
{
- ZY1000_POKE(0x08000014, 0x00000001);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x00000001);
}
else
{
/* Danger!!! if clk!=0 when in
* idle in TAP_RTI, reset halt on str912 will fail.
*/
}
else
{
/* Danger!!! if clk!=0 when in
* idle in TAP_RTI, reset halt on str912 will fail.
*/
- ZY1000_POKE(0x08000010, 0x00000001);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x00000001);
- ZY1000_POKE(0x08000014, 0x00000002);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x00000002);
}
else
{
/* assert reset */
}
else
{
/* assert reset */
- ZY1000_POKE(0x08000010, 0x00000002);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x00000002);
}
if (trst||(srst&&(jtag_reset_config & RESET_SRST_PULLS_TRST)))
{
waitIdle();
/* we're now in the TLR state until trst is deasserted */
}
if (trst||(srst&&(jtag_reset_config & RESET_SRST_PULLS_TRST)))
{
waitIdle();
/* we're now in the TLR state until trst is deasserted */
- ZY1000_POKE(0x08000020, TAP_TLR);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x20, TAP_TLR);
} else
{
/* We'll get RCLK failure when we assert TRST, so clear any false positives here */
} else
{
/* We'll get RCLK failure when we assert TRST, so clear any false positives here */
- ZY1000_POKE(0x08000014, 0x400);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x400);
}
/* wait for srst to float back up */
}
/* wait for srst to float back up */
{
/*0 means RCLK*/
speed = 0;
{
/*0 means RCLK*/
speed = 0;
- ZY1000_POKE(0x08000010, 0x100);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x100);
LOG_DEBUG("jtag_speed using RCLK");
}
else
LOG_DEBUG("jtag_speed using RCLK");
}
else
}
LOG_USER("jtag_speed %d => JTAG clk=%f", speed, 64.0/(float)speed);
}
LOG_USER("jtag_speed %d => JTAG clk=%f", speed, 64.0/(float)speed);
- ZY1000_POKE(0x08000014, 0x100);
- ZY1000_POKE(0x0800001c, speed&~1);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x100);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x1c, speed&~1);
- ZY1000_POKE(0x08000010, 0x30); // Turn on LED1 & LED2
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x30); // Turn on LED1 & LED2
/* deassert resets. Important to avoid infinite loop waiting for SRST to deassert */
zy1000_reset(0, 0);
/* deassert resets. Important to avoid infinite loop waiting for SRST to deassert */
zy1000_reset(0, 0);
cyg_uint32 empty;
waitIdle();
cyg_uint32 empty;
waitIdle();
- ZY1000_PEEK(0x08000010, empty);
+ ZY1000_PEEK(ZY1000_JTAG_BASE+0x10, empty);
/* clear JTAG error register */
/* clear JTAG error register */
- ZY1000_POKE(0x08000014, 0x400);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x400);
{
cyg_uint32 value;
waitIdle();
{
cyg_uint32 value;
waitIdle();
- ZY1000_PEEK(0x0800000c, value);
+ ZY1000_PEEK(ZY1000_JTAG_BASE+0xc, value);
VERBOSE(LOG_INFO("getShiftValue %08x", value));
return value;
}
VERBOSE(LOG_INFO("getShiftValue %08x", value));
return value;
}
{
cyg_uint32 value;
waitIdle();
{
cyg_uint32 value;
waitIdle();
- ZY1000_PEEK(0x08000018, value);
+ ZY1000_PEEK(ZY1000_JTAG_BASE+0x18, value);
VERBOSE(LOG_INFO("getShiftValue %08x (flipped)", value));
return value;
}
VERBOSE(LOG_INFO("getShiftValue %08x (flipped)", value));
return value;
}
cyg_uint32 a,b;
a=state;
b=endState;
cyg_uint32 a,b;
a=state;
b=endState;
- ZY1000_POKE(0x0800000c, value);
- ZY1000_POKE(0x08000008, (1<<15)|(repeat<<8)|(a<<4)|b);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x8, (1<<15)|(repeat<<8)|(a<<4)|b);
VERBOSE(getShiftValueFlip());
}
#endif
VERBOSE(getShiftValueFlip());
}
#endif
{
tms = (tms_scan >> i) & 1;
waitIdle();
{
tms = (tms_scan >> i) & 1;
waitIdle();
- ZY1000_POKE(0x08000028, tms);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x28, tms);
- ZY1000_POKE(0x08000020, state);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x20, state);
- ZY1000_POKE(0x08000028, tms);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x28, tms);
cur_state = path[state_count];
state_count++;
cur_state = path[state_count];
state_count++;
- ZY1000_POKE(0x08000020, cur_state);
+ ZY1000_POKE(ZY1000_JTAG_BASE+0x20, cur_state);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)