Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Biju Das and committed by
Greg Kroah-Hartman
f7acd12e dd0d2618

+50 -44
+49
drivers/usb/host/xhci-rcar-regs.h
··· 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 */
+1 -44
drivers/usb/host/xhci-rcar.c
··· 14 14 15 15 #include "xhci.h" 16 16 #include "xhci-plat.h" 17 + #include "xhci-rcar-regs.h" 17 18 #include "xhci-rzv2m.h" 18 19 19 20 #define XHCI_RCAR_FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem" ··· 29 28 */ 30 29 MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V1); 31 30 MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V3); 32 - 33 - /*** Register Offset ***/ 34 - #define RCAR_USB3_AXH_STA 0x104 /* AXI Host Control Status */ 35 - #define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */ 36 - #define RCAR_USB3_DL_CTRL 0x250 /* FW Download Control & Status */ 37 - #define RCAR_USB3_FW_DATA0 0x258 /* FW Data0 */ 38 - 39 - #define RCAR_USB3_LCLK 0xa44 /* LCLK Select */ 40 - #define RCAR_USB3_CONF1 0xa48 /* USB3.0 Configuration1 */ 41 - #define RCAR_USB3_CONF2 0xa5c /* USB3.0 Configuration2 */ 42 - #define RCAR_USB3_CONF3 0xaa8 /* USB3.0 Configuration3 */ 43 - #define RCAR_USB3_RX_POL 0xab0 /* USB3.0 RX Polarity */ 44 - #define RCAR_USB3_TX_POL 0xab8 /* USB3.0 TX Polarity */ 45 - 46 - /*** Register Settings ***/ 47 - /* AXI Host Control Status */ 48 - #define RCAR_USB3_AXH_STA_B3_PLL_ACTIVE 0x00010000 49 - #define RCAR_USB3_AXH_STA_B2_PLL_ACTIVE 0x00000001 50 - #define RCAR_USB3_AXH_STA_PLL_ACTIVE_MASK (RCAR_USB3_AXH_STA_B3_PLL_ACTIVE | \ 51 - RCAR_USB3_AXH_STA_B2_PLL_ACTIVE) 52 - 53 - /* Interrupt Enable */ 54 - #define RCAR_USB3_INT_XHC_ENA 0x00000001 55 - #define RCAR_USB3_INT_PME_ENA 0x00000002 56 - #define RCAR_USB3_INT_HSE_ENA 0x00000004 57 - #define RCAR_USB3_INT_ENA_VAL (RCAR_USB3_INT_XHC_ENA | \ 58 - RCAR_USB3_INT_PME_ENA | RCAR_USB3_INT_HSE_ENA) 59 - 60 - /* FW Download Control & Status */ 61 - #define RCAR_USB3_DL_CTRL_ENABLE 0x00000001 62 - #define RCAR_USB3_DL_CTRL_FW_SUCCESS 0x00000010 63 - #define RCAR_USB3_DL_CTRL_FW_SET_DATA0 0x00000100 64 - 65 - /* LCLK Select */ 66 - #define RCAR_USB3_LCLK_ENA_VAL 0x01030001 67 - 68 - /* USB3.0 Configuration */ 69 - #define RCAR_USB3_CONF1_VAL 0x00030204 70 - #define RCAR_USB3_CONF2_VAL 0x00030300 71 - #define RCAR_USB3_CONF3_VAL 0x13802007 72 - 73 - /* USB3.0 Polarity */ 74 - #define RCAR_USB3_RX_POL_VAL BIT(21) 75 - #define RCAR_USB3_TX_POL_VAL BIT(4) 76 31 77 32 static void xhci_rcar_start_gen2(struct usb_hcd *hcd) 78 33 {