# SPDX-License-Identifier: GPL-2.0-or-later

# Intel Cyclone IV FPGA
# see Cyclone IV Device Handbook
# Table 10-2: IDCODE Information for 32-Bit Cyclone IV Devices

#EP4CE6       0x020f10dd
#EP4CE10      0x020f10dd
#EP4CE15      0x020f20dd
#EP4CE22      0x020f30dd
#EP4CE30      0x020f40dd
#EP4CE40      0x020f40dd
#EP4CE55      0x020f50dd
#EP4CE75      0x020f60dd
#EP4CE115     0x020f70dd
#EP4CGX15     0x028010dd
#EP4CGX22     0x028120dd
#EP4CGX30 (3) 0x028020dd
#EP4CGX30 (4) 0x028230dd
#EP4CGX50     0x028130dd
#EP4CGX75     0x028030dd
#EP4CGX110    0x028140dd
#EP4CGX150    0x028040dd

if { [info exists CHIPNAME] } {
	set _CHIPNAME $CHIPNAME
} else {
	set _CHIPNAME cycloneiv
}

jtag newtap $_CHIPNAME tap -irlen 10 \
  -expected-id 0x020f10dd -expected-id 0x020f20dd \
  -expected-id 0x020f30dd -expected-id 0x020f40dd \
  -expected-id 0x020f50dd -expected-id 0x020f60dd \
  -expected-id 0x020f70dd -expected-id 0x028010dd \
  -expected-id 0x028120dd -expected-id 0x028020dd \
  -expected-id 0x028230dd -expected-id 0x028130dd \
  -expected-id 0x028030dd -expected-id 0x028140dd \
  -expected-id 0x028040dd

pld create $_CHIPNAME.pld intel -chain-position $_CHIPNAME.tap -family cycloneiv
