Skip to content

Commit f7acd12

Browse files
bijudasgregkh
authored andcommitted
usb: host: xhci-rcar: Move R-Car reg definitions
Move xhci-rcar reg definitions to a header file for the preparation of adding support for RZ/G3E XHCI that has different register definitions. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20250916150255.4231-5-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dd0d261 commit f7acd12

2 files changed

Lines changed: 50 additions & 44 deletions

File tree

drivers/usb/host/xhci-rcar-regs.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __XHCI_RCAR_H
3+
#define __XHCI_RCAR_H
4+
5+
/*** Register Offset ***/
6+
#define RCAR_USB3_AXH_STA 0x104 /* AXI Host Control Status */
7+
#define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */
8+
#define RCAR_USB3_DL_CTRL 0x250 /* FW Download Control & Status */
9+
#define RCAR_USB3_FW_DATA0 0x258 /* FW Data0 */
10+
11+
#define RCAR_USB3_LCLK 0xa44 /* LCLK Select */
12+
#define RCAR_USB3_CONF1 0xa48 /* USB3.0 Configuration1 */
13+
#define RCAR_USB3_CONF2 0xa5c /* USB3.0 Configuration2 */
14+
#define RCAR_USB3_CONF3 0xaa8 /* USB3.0 Configuration3 */
15+
#define RCAR_USB3_RX_POL 0xab0 /* USB3.0 RX Polarity */
16+
#define RCAR_USB3_TX_POL 0xab8 /* USB3.0 TX Polarity */
17+
18+
/*** Register Settings ***/
19+
/* AXI Host Control Status */
20+
#define RCAR_USB3_AXH_STA_B3_PLL_ACTIVE 0x00010000
21+
#define RCAR_USB3_AXH_STA_B2_PLL_ACTIVE 0x00000001
22+
#define RCAR_USB3_AXH_STA_PLL_ACTIVE_MASK (RCAR_USB3_AXH_STA_B3_PLL_ACTIVE | \
23+
RCAR_USB3_AXH_STA_B2_PLL_ACTIVE)
24+
25+
/* Interrupt Enable */
26+
#define RCAR_USB3_INT_XHC_ENA 0x00000001
27+
#define RCAR_USB3_INT_PME_ENA 0x00000002
28+
#define RCAR_USB3_INT_HSE_ENA 0x00000004
29+
#define RCAR_USB3_INT_ENA_VAL (RCAR_USB3_INT_XHC_ENA | \
30+
RCAR_USB3_INT_PME_ENA | RCAR_USB3_INT_HSE_ENA)
31+
32+
/* FW Download Control & Status */
33+
#define RCAR_USB3_DL_CTRL_ENABLE 0x00000001
34+
#define RCAR_USB3_DL_CTRL_FW_SUCCESS 0x00000010
35+
#define RCAR_USB3_DL_CTRL_FW_SET_DATA0 0x00000100
36+
37+
/* LCLK Select */
38+
#define RCAR_USB3_LCLK_ENA_VAL 0x01030001
39+
40+
/* USB3.0 Configuration */
41+
#define RCAR_USB3_CONF1_VAL 0x00030204
42+
#define RCAR_USB3_CONF2_VAL 0x00030300
43+
#define RCAR_USB3_CONF3_VAL 0x13802007
44+
45+
/* USB3.0 Polarity */
46+
#define RCAR_USB3_RX_POL_VAL BIT(21)
47+
#define RCAR_USB3_TX_POL_VAL BIT(4)
48+
49+
#endif /* __XHCI_RCAR_H */

drivers/usb/host/xhci-rcar.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "xhci.h"
1616
#include "xhci-plat.h"
17+
#include "xhci-rcar-regs.h"
1718
#include "xhci-rzv2m.h"
1819

1920
#define XHCI_RCAR_FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem"
@@ -29,50 +30,6 @@
2930
MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V1);
3031
MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V3);
3132

32-
/*** Register Offset ***/
33-
#define RCAR_USB3_AXH_STA 0x104 /* AXI Host Control Status */
34-
#define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */
35-
#define RCAR_USB3_DL_CTRL 0x250 /* FW Download Control & Status */
36-
#define RCAR_USB3_FW_DATA0 0x258 /* FW Data0 */
37-
38-
#define RCAR_USB3_LCLK 0xa44 /* LCLK Select */
39-
#define RCAR_USB3_CONF1 0xa48 /* USB3.0 Configuration1 */
40-
#define RCAR_USB3_CONF2 0xa5c /* USB3.0 Configuration2 */
41-
#define RCAR_USB3_CONF3 0xaa8 /* USB3.0 Configuration3 */
42-
#define RCAR_USB3_RX_POL 0xab0 /* USB3.0 RX Polarity */
43-
#define RCAR_USB3_TX_POL 0xab8 /* USB3.0 TX Polarity */
44-
45-
/*** Register Settings ***/
46-
/* AXI Host Control Status */
47-
#define RCAR_USB3_AXH_STA_B3_PLL_ACTIVE 0x00010000
48-
#define RCAR_USB3_AXH_STA_B2_PLL_ACTIVE 0x00000001
49-
#define RCAR_USB3_AXH_STA_PLL_ACTIVE_MASK (RCAR_USB3_AXH_STA_B3_PLL_ACTIVE | \
50-
RCAR_USB3_AXH_STA_B2_PLL_ACTIVE)
51-
52-
/* Interrupt Enable */
53-
#define RCAR_USB3_INT_XHC_ENA 0x00000001
54-
#define RCAR_USB3_INT_PME_ENA 0x00000002
55-
#define RCAR_USB3_INT_HSE_ENA 0x00000004
56-
#define RCAR_USB3_INT_ENA_VAL (RCAR_USB3_INT_XHC_ENA | \
57-
RCAR_USB3_INT_PME_ENA | RCAR_USB3_INT_HSE_ENA)
58-
59-
/* FW Download Control & Status */
60-
#define RCAR_USB3_DL_CTRL_ENABLE 0x00000001
61-
#define RCAR_USB3_DL_CTRL_FW_SUCCESS 0x00000010
62-
#define RCAR_USB3_DL_CTRL_FW_SET_DATA0 0x00000100
63-
64-
/* LCLK Select */
65-
#define RCAR_USB3_LCLK_ENA_VAL 0x01030001
66-
67-
/* USB3.0 Configuration */
68-
#define RCAR_USB3_CONF1_VAL 0x00030204
69-
#define RCAR_USB3_CONF2_VAL 0x00030300
70-
#define RCAR_USB3_CONF3_VAL 0x13802007
71-
72-
/* USB3.0 Polarity */
73-
#define RCAR_USB3_RX_POL_VAL BIT(21)
74-
#define RCAR_USB3_TX_POL_VAL BIT(4)
75-
7633
static void xhci_rcar_start_gen2(struct usb_hcd *hcd)
7734
{
7835
/* LCLK Select */

0 commit comments

Comments
 (0)