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

Merge branch 'pci/switchtec' into next

* pci/switchtec:
switchtec: Add device IDs for additional Switchtec products
switchtec: Add "running" status flag to fw partition info ioctl

+41 -2
+38 -2
drivers/pci/switch/switchtec.c
··· 120 120 u32 reserved16[4]; 121 121 } __packed; 122 122 123 + enum { 124 + SWITCHTEC_CFG0_RUNNING = 0x04, 125 + SWITCHTEC_CFG1_RUNNING = 0x05, 126 + SWITCHTEC_IMG0_RUNNING = 0x03, 127 + SWITCHTEC_IMG1_RUNNING = 0x07, 128 + }; 129 + 123 130 struct sys_info_regs { 124 131 u32 device_id; 125 132 u32 device_version; ··· 136 129 u32 table_format_version; 137 130 u32 partition_id; 138 131 u32 cfg_file_fmt_version; 139 - u32 reserved2[58]; 132 + u16 cfg_running; 133 + u16 img_running; 134 + u32 reserved2[57]; 140 135 char vendor_id[8]; 141 136 char product_id[16]; 142 137 char product_revision[4]; ··· 816 807 { 817 808 struct switchtec_ioctl_flash_part_info info = {0}; 818 809 struct flash_info_regs __iomem *fi = stdev->mmio_flash_info; 810 + struct sys_info_regs __iomem *si = stdev->mmio_sys_info; 819 811 u32 active_addr = -1; 820 812 821 813 if (copy_from_user(&info, uinfo, sizeof(info))) ··· 826 816 case SWITCHTEC_IOCTL_PART_CFG0: 827 817 active_addr = ioread32(&fi->active_cfg); 828 818 set_fw_info_part(&info, &fi->cfg0); 819 + if (ioread16(&si->cfg_running) == SWITCHTEC_CFG0_RUNNING) 820 + info.active |= SWITCHTEC_IOCTL_PART_RUNNING; 829 821 break; 830 822 case SWITCHTEC_IOCTL_PART_CFG1: 831 823 active_addr = ioread32(&fi->active_cfg); 832 824 set_fw_info_part(&info, &fi->cfg1); 825 + if (ioread16(&si->cfg_running) == SWITCHTEC_CFG1_RUNNING) 826 + info.active |= SWITCHTEC_IOCTL_PART_RUNNING; 833 827 break; 834 828 case SWITCHTEC_IOCTL_PART_IMG0: 835 829 active_addr = ioread32(&fi->active_img); 836 830 set_fw_info_part(&info, &fi->img0); 831 + if (ioread16(&si->img_running) == SWITCHTEC_IMG0_RUNNING) 832 + info.active |= SWITCHTEC_IOCTL_PART_RUNNING; 837 833 break; 838 834 case SWITCHTEC_IOCTL_PART_IMG1: 839 835 active_addr = ioread32(&fi->active_img); 840 836 set_fw_info_part(&info, &fi->img1); 837 + if (ioread16(&si->img_running) == SWITCHTEC_IMG1_RUNNING) 838 + info.active |= SWITCHTEC_IOCTL_PART_RUNNING; 841 839 break; 842 840 case SWITCHTEC_IOCTL_PART_NVLOG: 843 841 set_fw_info_part(&info, &fi->nvlog); ··· 879 861 } 880 862 881 863 if (info.address == active_addr) 882 - info.active = 1; 864 + info.active |= SWITCHTEC_IOCTL_PART_ACTIVE; 883 865 884 866 if (copy_to_user(uinfo, &info, sizeof(info))) 885 867 return -EFAULT; ··· 1558 1540 SWITCHTEC_PCI_DEVICE(0x8544), //PSX 64xG3 1559 1541 SWITCHTEC_PCI_DEVICE(0x8545), //PSX 80xG3 1560 1542 SWITCHTEC_PCI_DEVICE(0x8546), //PSX 96xG3 1543 + SWITCHTEC_PCI_DEVICE(0x8551), //PAX 24XG3 1544 + SWITCHTEC_PCI_DEVICE(0x8552), //PAX 32XG3 1545 + SWITCHTEC_PCI_DEVICE(0x8553), //PAX 48XG3 1546 + SWITCHTEC_PCI_DEVICE(0x8554), //PAX 64XG3 1547 + SWITCHTEC_PCI_DEVICE(0x8555), //PAX 80XG3 1548 + SWITCHTEC_PCI_DEVICE(0x8556), //PAX 96XG3 1549 + SWITCHTEC_PCI_DEVICE(0x8561), //PFXL 24XG3 1550 + SWITCHTEC_PCI_DEVICE(0x8562), //PFXL 32XG3 1551 + SWITCHTEC_PCI_DEVICE(0x8563), //PFXL 48XG3 1552 + SWITCHTEC_PCI_DEVICE(0x8564), //PFXL 64XG3 1553 + SWITCHTEC_PCI_DEVICE(0x8565), //PFXL 80XG3 1554 + SWITCHTEC_PCI_DEVICE(0x8566), //PFXL 96XG3 1555 + SWITCHTEC_PCI_DEVICE(0x8571), //PFXI 24XG3 1556 + SWITCHTEC_PCI_DEVICE(0x8572), //PFXI 32XG3 1557 + SWITCHTEC_PCI_DEVICE(0x8573), //PFXI 48XG3 1558 + SWITCHTEC_PCI_DEVICE(0x8574), //PFXI 64XG3 1559 + SWITCHTEC_PCI_DEVICE(0x8575), //PFXI 80XG3 1560 + SWITCHTEC_PCI_DEVICE(0x8576), //PFXI 96XG3 1561 1561 {0} 1562 1562 }; 1563 1563 MODULE_DEVICE_TABLE(pci, switchtec_pci_tbl);
+3
include/uapi/linux/switchtec_ioctl.h
··· 39 39 __u32 padding; 40 40 }; 41 41 42 + #define SWITCHTEC_IOCTL_PART_ACTIVE 1 43 + #define SWITCHTEC_IOCTL_PART_RUNNING 2 44 + 42 45 struct switchtec_ioctl_flash_part_info { 43 46 __u32 flash_partition; 44 47 __u32 address;