public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3
@ 2025-03-12  3:05 Boon Khai Ng
  2025-03-12 16:57 ` Johan Hovold
  0 siblings, 1 reply; 5+ messages in thread
From: Boon Khai Ng @ 2025-03-12  3:05 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, linux-usb, linux-kernel
  Cc: Boon Khai Ng, Tien Sung Ang, Boon Khai Ng

The Altera USB Blaster 3, available as both a cable and an on-board
solution, is primarily used for programming and debugging FPGAs.

It interfaces with host software such as Quartus Programmer,
System Console, SignalTap, and Nios Debugger. The device utilizes
either an FT2232 or FT4232 chip.

Enabling the support for various configurations of the on-board
USB Blaster 3 by including the appropriate VID/PID pairs,
allowing it to function as a serial device via ftdi_sio.

Note that this check-in does not include support for the
cable solution, as it does not support UART functionality.
The supported configurations are determined by the
hardware design and include:

1) PID 0x6022, FT2232, 1 JTAG port (Port A) + Port B as UART
2) PID 0x6025, FT4232, 1 JTAG port (Port A) + Port C as UART
3) PID 0x6026, FT4232, 1 JTAG port (Port A) + Port C, D as UART
4) PID 0x6029, FT4232, 1 JTAG port (Port B) + Port C as UART
5) PID 0x602a, FT4232, 1 JTAG port (Port B) + Port C, D as UART
6) PID 0x602c, FT4232, 1 JTAG port (Port A) + Port B as UART
7) PID 0x602d, FT4232, 1 JTAG port (Port A) + Port B, C as UART
8) PID 0x602e, FT4232, 1 JTAG port (Port A) + Port B, C, D as UART

These configurations allow for flexibility in how the USB Blaster 3 is
used, depending on the specific needs of the hardware design.

---

v3: Updated PID table.

PID table in the commit message in v2 missmatched with the PID macro
defined in the header file, updated the correct table in v3.

---

v2: Update commit message, added PID table, updated the macro name

Updated the commit message to include more information about the
background of what is this change about. Added the PID table to
clarify that the PID associated to the specific hardware configuration
Updated the macro name in header file from ALTR to ALTERA and also
the VID's macro name to ALTERA_VID

Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.com>
---
 drivers/usb/serial/ftdi_sio.c     | 14 ++++++++++++++
 drivers/usb/serial/ftdi_sio_ids.h | 13 +++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e07c5e3eb18c..9b34e23b7091 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1079,6 +1079,20 @@ static const struct usb_device_id id_table_combined[] = {
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	/* GMC devices */
 	{ USB_DEVICE(GMC_VID, GMC_Z216C_PID) },
+	/* Altera USB Blaster 3 */
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6022_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6025_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 3) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6029_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 3) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602C_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 2) },
+	{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 3) },
 	{ }					/* Terminating entry */
 };
 
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 5ee60ba2a73c..52be47d684ea 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1612,3 +1612,16 @@
  */
 #define GMC_VID				0x1cd7
 #define GMC_Z216C_PID			0x0217 /* GMC Z216C Adapter IR-USB */
+
+/*
+ *  Altera USB Blaster 3 (http://www.altera.com).
+ */
+#define ALTERA_VID			0x09fb
+#define ALTERA_UB3_6022_PID		0x6022
+#define ALTERA_UB3_6025_PID		0x6025
+#define ALTERA_UB3_6026_PID		0x6026
+#define ALTERA_UB3_6029_PID		0x6029
+#define ALTERA_UB3_602A_PID		0x602a
+#define ALTERA_UB3_602C_PID		0x602c
+#define ALTERA_UB3_602D_PID		0x602d
+#define ALTERA_UB3_602E_PID		0x602e
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3
  2025-03-12  3:05 [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3 Boon Khai Ng
@ 2025-03-12 16:57 ` Johan Hovold
  2025-03-14  2:14   ` Ng, Boon Khai
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2025-03-12 16:57 UTC (permalink / raw)
  To: Boon Khai Ng
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Boon Khai Ng,
	Tien Sung Ang

On Wed, Mar 12, 2025 at 11:05:44AM +0800, Boon Khai Ng wrote:
> The Altera USB Blaster 3, available as both a cable and an on-board
> solution, is primarily used for programming and debugging FPGAs.

> These configurations allow for flexibility in how the USB Blaster 3 is
> used, depending on the specific needs of the hardware design.
> 
> ---
> 
> v3: Updated PID table.
> 
> PID table in the commit message in v2 missmatched with the PID macro
> defined in the header file, updated the correct table in v3.
> 
> ---
> 
> v2: Update commit message, added PID table, updated the macro name
> 
> Updated the commit message to include more information about the
> background of what is this change about. Added the PID table to
> clarify that the PID associated to the specific hardware configuration
> Updated the macro name in header file from ALTR to ALTERA and also
> the VID's macro name to ALTERA_VID
> 
> Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.com>

Thanks for the update, now applied.

Next time, remember to put your SoB above the (first) cut-off line (---)
so that it is included in the commit message when your patch is applied.
I fixed that up manually this time.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3
  2025-03-12 16:57 ` Johan Hovold
@ 2025-03-14  2:14   ` Ng, Boon Khai
  2025-03-14  7:24     ` Johan Hovold
  0 siblings, 1 reply; 5+ messages in thread
From: Ng, Boon Khai @ 2025-03-14  2:14 UTC (permalink / raw)
  To: Johan Hovold, Boon Khai Ng
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Ang, Tien Sung

> Thanks for the update, now applied.
> 
> Next time, remember to put your SoB above the (first) cut-off line (---) so that
> it is included in the commit message when your patch is applied.
> I fixed that up manually this time.
> 

Thank you for your feedback and for applying the update.
I apologize for the misunderstanding regarding the placement of the SoB. 
I mistakenly thought I needed to create the cut-off line myself in the 
commit message. 

I now understand that I should generate the patch first and then
manually add the change log under the first cut-off line that
appears below the sign-off.

I appreciate your kindness in manually editing the changelog
this time. Thank you for your guidance and support.

Regards,
Boon Khai.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3
  2025-03-14  2:14   ` Ng, Boon Khai
@ 2025-03-14  7:24     ` Johan Hovold
  2025-03-17  1:48       ` Ng, Boon Khai
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2025-03-14  7:24 UTC (permalink / raw)
  To: Ng, Boon Khai
  Cc: Boon Khai Ng, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Ang, Tien Sung

On Fri, Mar 14, 2025 at 02:14:47AM +0000, Ng, Boon Khai wrote:
> > Thanks for the update, now applied.
> > 
> > Next time, remember to put your SoB above the (first) cut-off line (---) so that
> > it is included in the commit message when your patch is applied.
> > I fixed that up manually this time.
> 
> Thank you for your feedback and for applying the update.
> I apologize for the misunderstanding regarding the placement of the SoB. 
> I mistakenly thought I needed to create the cut-off line myself in the 
> commit message. 

No worries.

> I now understand that I should generate the patch first and then
> manually add the change log under the first cut-off line that
> appears below the sign-off.

That's what I do, but if you add your SoB followed by a cut-off line and
change log to your local commit, then that should also work if you later
run git-format-patch.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3
  2025-03-14  7:24     ` Johan Hovold
@ 2025-03-17  1:48       ` Ng, Boon Khai
  0 siblings, 0 replies; 5+ messages in thread
From: Ng, Boon Khai @ 2025-03-17  1:48 UTC (permalink / raw)
  To: Johan Hovold, Ng, Boon Khai
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Ang, Tien Sung

 > That's what I do, but if you add your SoB followed by a cut-off line and change
> log to your local commit, then that should also work if you later run git-
> format-patch.
> 

Hi Johan, thank you for clarifying the step. Will make sure that I follow the step
in the future to ensure everything formatted correctly especially on the SoB.

Thanks again for your guidance and support 

Regards,
Boon Khai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-17  1:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12  3:05 [PATCH v3] USB: serial: ftdi_sio: add support for Altera USB Blaster 3 Boon Khai Ng
2025-03-12 16:57 ` Johan Hovold
2025-03-14  2:14   ` Ng, Boon Khai
2025-03-14  7:24     ` Johan Hovold
2025-03-17  1:48       ` Ng, Boon Khai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox