|
648 | 648 | /* BXT PHY common lane registers */
|
649 | 649 | #define _PORT_CL1CM_DW0_A 0x162000
|
650 | 650 | #define _PORT_CL1CM_DW0_BC 0x6C000
|
651 |
| -#define PHY_POWER_GOOD (1 << 16) |
652 |
| -#define PHY_RESERVED (1 << 7) |
| 651 | +#define PHY_POWER_GOOD REG_BIT(16) |
| 652 | +#define PHY_RESERVED REG_BIT(7) |
653 | 653 | #define BXT_PORT_CL1CM_DW0(phy) _BXT_PHY((phy), _PORT_CL1CM_DW0_BC)
|
654 | 654 |
|
655 | 655 | #define _PORT_CL1CM_DW9_A 0x162024
|
656 | 656 | #define _PORT_CL1CM_DW9_BC 0x6C024
|
657 |
| -#define IREF0RC_OFFSET_SHIFT 8 |
658 |
| -#define IREF0RC_OFFSET_MASK (0xFF << IREF0RC_OFFSET_SHIFT) |
| 657 | +#define IREF0RC_OFFSET_MASK REG_GENMASK(15, 8) |
| 658 | +#define IREF0RC_OFFSET(x) REG_FIELD_PREP(IREF0RC_OFFSET_MASK, (x)) |
659 | 659 | #define BXT_PORT_CL1CM_DW9(phy) _BXT_PHY((phy), _PORT_CL1CM_DW9_BC)
|
660 | 660 |
|
661 | 661 | #define _PORT_CL1CM_DW10_A 0x162028
|
662 | 662 | #define _PORT_CL1CM_DW10_BC 0x6C028
|
663 |
| -#define IREF1RC_OFFSET_SHIFT 8 |
664 |
| -#define IREF1RC_OFFSET_MASK (0xFF << IREF1RC_OFFSET_SHIFT) |
| 663 | +#define IREF1RC_OFFSET_MASK REG_GENMASK(15, 8) |
| 664 | +#define IREF1RC_OFFSET(x) REG_FIELD_PREP(IREF1RC_OFFSET_MASK, (x)) |
665 | 665 | #define BXT_PORT_CL1CM_DW10(phy) _BXT_PHY((phy), _PORT_CL1CM_DW10_BC)
|
666 | 666 |
|
667 | 667 | #define _PORT_CL1CM_DW28_A 0x162070
|
668 | 668 | #define _PORT_CL1CM_DW28_BC 0x6C070
|
669 |
| -#define OCL1_POWER_DOWN_EN (1 << 23) |
670 |
| -#define DW28_OLDO_DYN_PWR_DOWN_EN (1 << 22) |
671 |
| -#define SUS_CLK_CONFIG 0x3 |
| 669 | +#define OCL1_POWER_DOWN_EN REG_BIT(23) |
| 670 | +#define DW28_OLDO_DYN_PWR_DOWN_EN REG_BIT(22) |
| 671 | +#define SUS_CLK_CONFIG REG_GENMASK(1, 0) |
672 | 672 | #define BXT_PORT_CL1CM_DW28(phy) _BXT_PHY((phy), _PORT_CL1CM_DW28_BC)
|
673 | 673 |
|
674 | 674 | #define _PORT_CL1CM_DW30_A 0x162078
|
675 | 675 | #define _PORT_CL1CM_DW30_BC 0x6C078
|
676 |
| -#define OCL2_LDOFUSE_PWR_DIS (1 << 6) |
| 676 | +#define OCL2_LDOFUSE_PWR_DIS REG_BIT(6) |
677 | 677 | #define BXT_PORT_CL1CM_DW30(phy) _BXT_PHY((phy), _PORT_CL1CM_DW30_BC)
|
678 | 678 |
|
679 | 679 | /* The spec defines this only for BXT PHY0, but lets assume that this
|
|
682 | 682 | #define _PORT_CL2CM_DW6_A 0x162358
|
683 | 683 | #define _PORT_CL2CM_DW6_BC 0x6C358
|
684 | 684 | #define BXT_PORT_CL2CM_DW6(phy) _BXT_PHY((phy), _PORT_CL2CM_DW6_BC)
|
685 |
| -#define DW6_OLDO_DYN_PWR_DOWN_EN (1 << 28) |
| 685 | +#define DW6_OLDO_DYN_PWR_DOWN_EN REG_BIT(28) |
686 | 686 |
|
687 | 687 | /* BXT PHY Ref registers */
|
688 | 688 | #define _PORT_REF_DW3_A 0x16218C
|
689 | 689 | #define _PORT_REF_DW3_BC 0x6C18C
|
690 |
| -#define GRC_DONE (1 << 22) |
| 690 | +#define GRC_DONE REG_BIT(22) |
691 | 691 | #define BXT_PORT_REF_DW3(phy) _BXT_PHY((phy), _PORT_REF_DW3_BC)
|
692 | 692 |
|
693 | 693 | #define _PORT_REF_DW6_A 0x162198
|
694 | 694 | #define _PORT_REF_DW6_BC 0x6C198
|
695 |
| -#define GRC_CODE_SHIFT 24 |
696 |
| -#define GRC_CODE_MASK (0xFF << GRC_CODE_SHIFT) |
697 |
| -#define GRC_CODE_FAST_SHIFT 16 |
698 |
| -#define GRC_CODE_FAST_MASK (0xFF << GRC_CODE_FAST_SHIFT) |
699 |
| -#define GRC_CODE_SLOW_SHIFT 8 |
700 |
| -#define GRC_CODE_SLOW_MASK (0xFF << GRC_CODE_SLOW_SHIFT) |
701 |
| -#define GRC_CODE_NOM_MASK 0xFF |
| 695 | +#define GRC_CODE_MASK REG_GENMASK(31, 24) |
| 696 | +#define GRC_CODE(x) REG_FIELD_PREP(GRC_CODE_MASK, (x)) |
| 697 | +#define GRC_CODE_FAST_MASK REG_GENMASK(23, 16) |
| 698 | +#define GRC_CODE_FAST(x) REG_FIELD_PREP(GRC_CODE_FAST_MASK, (x)) |
| 699 | +#define GRC_CODE_SLOW_MASK REG_GENMASK(15, 8) |
| 700 | +#define GRC_CODE_SLOW(x) REG_FIELD_PREP(GRC_CODE_SLOW_MASK, (x)) |
| 701 | +#define GRC_CODE_NOM_MASK REG_GENMASK(7, 0) |
| 702 | +#define GRC_CODE_NOM(x) REG_FIELD_PREP(GRC_CODE_NOM_MASK, (x)) |
702 | 703 | #define BXT_PORT_REF_DW6(phy) _BXT_PHY((phy), _PORT_REF_DW6_BC)
|
703 | 704 |
|
704 | 705 | #define _PORT_REF_DW8_A 0x1621A0
|
705 | 706 | #define _PORT_REF_DW8_BC 0x6C1A0
|
706 |
| -#define GRC_DIS (1 << 15) |
707 |
| -#define GRC_RDY_OVRD (1 << 1) |
| 707 | +#define GRC_DIS REG_BIT(15) |
| 708 | +#define GRC_RDY_OVRD REG_BIT(1) |
708 | 709 | #define BXT_PORT_REF_DW8(phy) _BXT_PHY((phy), _PORT_REF_DW8_BC)
|
709 | 710 |
|
710 | 711 | /* BXT PHY PCS registers */
|
|
721 | 722 | _PORT_PCS_DW10_GRP_B, \
|
722 | 723 | _PORT_PCS_DW10_GRP_C)
|
723 | 724 |
|
724 |
| -#define TX2_SWING_CALC_INIT (1 << 31) |
725 |
| -#define TX1_SWING_CALC_INIT (1 << 30) |
| 725 | +#define TX2_SWING_CALC_INIT REG_BIT(31) |
| 726 | +#define TX1_SWING_CALC_INIT REG_BIT(30) |
726 | 727 |
|
727 | 728 | #define _PORT_PCS_DW12_LN01_A 0x162430
|
728 | 729 | #define _PORT_PCS_DW12_LN01_B 0x6C430
|
|
733 | 734 | #define _PORT_PCS_DW12_GRP_A 0x162c30
|
734 | 735 | #define _PORT_PCS_DW12_GRP_B 0x6CC30
|
735 | 736 | #define _PORT_PCS_DW12_GRP_C 0x6CE30
|
736 |
| -#define LANESTAGGER_STRAP_OVRD (1 << 6) |
737 |
| -#define LANE_STAGGER_MASK 0x1F |
| 737 | +#define LANESTAGGER_STRAP_OVRD REG_BIT(6) |
| 738 | +#define LANE_STAGGER_MASK REG_GENMASK(4, 0) |
738 | 739 | #define BXT_PORT_PCS_DW12_LN01(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \
|
739 | 740 | _PORT_PCS_DW12_LN01_B, \
|
740 | 741 | _PORT_PCS_DW12_LN01_C)
|
|
761 | 762 | #define BXT_PORT_TX_DW2_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \
|
762 | 763 | _PORT_TX_DW2_GRP_B, \
|
763 | 764 | _PORT_TX_DW2_GRP_C)
|
764 |
| -#define MARGIN_000_SHIFT 16 |
765 |
| -#define MARGIN_000 (0xFF << MARGIN_000_SHIFT) |
766 |
| -#define UNIQ_TRANS_SCALE_SHIFT 8 |
767 |
| -#define UNIQ_TRANS_SCALE (0xFF << UNIQ_TRANS_SCALE_SHIFT) |
| 765 | +#define MARGIN_000_MASK REG_GENMASK(23, 16) |
| 766 | +#define MARGIN_000(x) REG_FIELD_PREP(MARGIN_000_MASK, (x)) |
| 767 | +#define UNIQ_TRANS_SCALE_MASK REG_GENMASK(15, 8) |
| 768 | +#define UNIQ_TRANS_SCALE(x) REG_FIELD_PREP(UNIQ_TRANS_SCALE_MASK, (x)) |
768 | 769 |
|
769 | 770 | #define _PORT_TX_DW3_LN0_A 0x16250C
|
770 | 771 | #define _PORT_TX_DW3_LN0_B 0x6C50C
|
|
778 | 779 | #define BXT_PORT_TX_DW3_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \
|
779 | 780 | _PORT_TX_DW3_GRP_B, \
|
780 | 781 | _PORT_TX_DW3_GRP_C)
|
781 |
| -#define SCALE_DCOMP_METHOD (1 << 26) |
782 |
| -#define UNIQUE_TRANGE_EN_METHOD (1 << 27) |
| 782 | +#define SCALE_DCOMP_METHOD REG_BIT(26) |
| 783 | +#define UNIQUE_TRANGE_EN_METHOD REG_BIT(27) |
783 | 784 |
|
784 | 785 | #define _PORT_TX_DW4_LN0_A 0x162510
|
785 | 786 | #define _PORT_TX_DW4_LN0_B 0x6C510
|
|
793 | 794 | #define BXT_PORT_TX_DW4_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \
|
794 | 795 | _PORT_TX_DW4_GRP_B, \
|
795 | 796 | _PORT_TX_DW4_GRP_C)
|
796 |
| -#define DEEMPH_SHIFT 24 |
797 |
| -#define DE_EMPHASIS (0xFF << DEEMPH_SHIFT) |
| 797 | +#define DE_EMPHASIS_MASK REG_GENMASK(31, 24) |
| 798 | +#define DE_EMPHASIS(x) REG_FIELD_PREP(DE_EMPHASIS_MASK, (x)) |
798 | 799 |
|
799 | 800 | #define _PORT_TX_DW5_LN0_A 0x162514
|
800 | 801 | #define _PORT_TX_DW5_LN0_B 0x6C514
|
|
808 | 809 | #define BXT_PORT_TX_DW5_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \
|
809 | 810 | _PORT_TX_DW5_GRP_B, \
|
810 | 811 | _PORT_TX_DW5_GRP_C)
|
811 |
| -#define DCC_DELAY_RANGE_1 (1 << 9) |
812 |
| -#define DCC_DELAY_RANGE_2 (1 << 8) |
| 812 | +#define DCC_DELAY_RANGE_1 REG_BIT(9) |
| 813 | +#define DCC_DELAY_RANGE_2 REG_BIT(8) |
813 | 814 |
|
814 | 815 | #define _PORT_TX_DW14_LN0_A 0x162538
|
815 | 816 | #define _PORT_TX_DW14_LN0_B 0x6C538
|
816 | 817 | #define _PORT_TX_DW14_LN0_C 0x6C938
|
817 |
| -#define LATENCY_OPTIM_SHIFT 30 |
818 |
| -#define LATENCY_OPTIM (1 << LATENCY_OPTIM_SHIFT) |
| 818 | +#define LATENCY_OPTIM REG_BIT(30) |
819 | 819 | #define BXT_PORT_TX_DW14_LN(phy, ch, lane) \
|
820 | 820 | _MMIO(_BXT_PHY_CH(phy, ch, _PORT_TX_DW14_LN0_B, \
|
821 | 821 | _PORT_TX_DW14_LN0_C) + \
|
|
0 commit comments