···11-# CONFIG_LOCALVERSION_AUTO is not set22-CONFIG_SYSVIPC=y33-CONFIG_POSIX_MQUEUE=y44-CONFIG_AUDIT=y55-CONFIG_NO_HZ=y66-CONFIG_HIGH_RES_TIMERS=y77-CONFIG_BSD_PROCESS_ACCT=y88-CONFIG_BSD_PROCESS_ACCT_V3=y99-CONFIG_TASKSTATS=y1010-CONFIG_TASK_DELAY_ACCT=y1111-CONFIG_TASK_XACCT=y1212-CONFIG_TASK_IO_ACCOUNTING=y1313-CONFIG_CGROUPS=y1414-CONFIG_NAMESPACES=y1515-CONFIG_BLK_DEV_INITRD=y1616-CONFIG_KALLSYMS_ALL=y1717-CONFIG_EMBEDDED=y1818-# CONFIG_COMPAT_BRK is not set1919-CONFIG_PROFILING=y2020-CONFIG_NLM_XLP_BOARD=y2121-CONFIG_64BIT=y2222-CONFIG_PAGE_SIZE_16KB=y2323-# CONFIG_HW_PERF_EVENTS is not set2424-CONFIG_SMP=y2525-# CONFIG_SECCOMP is not set2626-CONFIG_PCI=y2727-CONFIG_PCI_DEBUG=y2828-CONFIG_PCI_STUB=y2929-CONFIG_MIPS32_O32=y3030-CONFIG_MIPS32_N32=y3131-CONFIG_PM=y3232-CONFIG_PM_DEBUG=y3333-CONFIG_MODULES=y3434-CONFIG_MODULE_UNLOAD=y3535-CONFIG_MODVERSIONS=y3636-CONFIG_MODULE_SRCVERSION_ALL=y3737-CONFIG_BLK_DEV_INTEGRITY=y3838-CONFIG_PARTITION_ADVANCED=y3939-CONFIG_ACORN_PARTITION=y4040-CONFIG_ACORN_PARTITION_ICS=y4141-CONFIG_ACORN_PARTITION_RISCIX=y4242-CONFIG_OSF_PARTITION=y4343-CONFIG_AMIGA_PARTITION=y4444-CONFIG_ATARI_PARTITION=y4545-CONFIG_MAC_PARTITION=y4646-CONFIG_BSD_DISKLABEL=y4747-CONFIG_MINIX_SUBPARTITION=y4848-CONFIG_SOLARIS_X86_PARTITION=y4949-CONFIG_UNIXWARE_DISKLABEL=y5050-CONFIG_LDM_PARTITION=y5151-CONFIG_SGI_PARTITION=y5252-CONFIG_ULTRIX_PARTITION=y5353-CONFIG_SUN_PARTITION=y5454-CONFIG_KARMA_PARTITION=y5555-CONFIG_SYSV68_PARTITION=y5656-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set5757-CONFIG_BINFMT_MISC=y5858-CONFIG_KSM=y5959-CONFIG_DEFAULT_MMAP_MIN_ADDR=655366060-CONFIG_NET=y6161-CONFIG_PACKET=y6262-CONFIG_UNIX=y6363-CONFIG_XFRM_USER=m6464-CONFIG_NET_KEY=m6565-CONFIG_INET=y6666-CONFIG_IP_MULTICAST=y6767-CONFIG_IP_ADVANCED_ROUTER=y6868-CONFIG_IP_MULTIPLE_TABLES=y6969-CONFIG_IP_ROUTE_MULTIPATH=y7070-CONFIG_IP_ROUTE_VERBOSE=y7171-CONFIG_NET_IPIP=m7272-CONFIG_IP_MROUTE=y7373-CONFIG_IP_PIMSM_V1=y7474-CONFIG_IP_PIMSM_V2=y7575-CONFIG_SYN_COOKIES=y7676-CONFIG_INET_AH=m7777-CONFIG_INET_ESP=m7878-CONFIG_INET_IPCOMP=m7979-CONFIG_INET_XFRM_MODE_TRANSPORT=m8080-CONFIG_INET_XFRM_MODE_TUNNEL=m8181-CONFIG_INET_XFRM_MODE_BEET=m8282-CONFIG_TCP_CONG_ADVANCED=y8383-CONFIG_TCP_CONG_HSTCP=m8484-CONFIG_TCP_CONG_HYBLA=m8585-CONFIG_TCP_CONG_SCALABLE=m8686-CONFIG_TCP_CONG_LP=m8787-CONFIG_TCP_CONG_VENO=m8888-CONFIG_TCP_CONG_YEAH=m8989-CONFIG_TCP_CONG_ILLINOIS=m9090-CONFIG_TCP_MD5SIG=y9191-CONFIG_INET6_AH=m9292-CONFIG_INET6_ESP=m9393-CONFIG_INET6_IPCOMP=m9494-CONFIG_INET6_XFRM_MODE_TRANSPORT=m9595-CONFIG_INET6_XFRM_MODE_TUNNEL=m9696-CONFIG_INET6_XFRM_MODE_BEET=m9797-CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m9898-CONFIG_IPV6_SIT=m9999-CONFIG_IPV6_TUNNEL=m100100-CONFIG_IPV6_MULTIPLE_TABLES=y101101-CONFIG_NETFILTER=y102102-CONFIG_NF_CONNTRACK=m103103-CONFIG_NF_CONNTRACK_SECMARK=y104104-CONFIG_NF_CONNTRACK_EVENTS=y105105-CONFIG_NF_CONNTRACK_AMANDA=m106106-CONFIG_NF_CONNTRACK_FTP=m107107-CONFIG_NF_CONNTRACK_H323=m108108-CONFIG_NF_CONNTRACK_IRC=m109109-CONFIG_NF_CONNTRACK_NETBIOS_NS=m110110-CONFIG_NF_CONNTRACK_PPTP=m111111-CONFIG_NF_CONNTRACK_SANE=m112112-CONFIG_NF_CONNTRACK_SIP=m113113-CONFIG_NF_CONNTRACK_TFTP=m114114-CONFIG_NF_CT_NETLINK=m115115-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m116116-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m117117-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m118118-CONFIG_NETFILTER_XT_TARGET_DSCP=m119119-CONFIG_NETFILTER_XT_TARGET_MARK=m120120-CONFIG_NETFILTER_XT_TARGET_NFLOG=m121121-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m122122-CONFIG_NETFILTER_XT_TARGET_TPROXY=m123123-CONFIG_NETFILTER_XT_TARGET_TRACE=m124124-CONFIG_NETFILTER_XT_TARGET_SECMARK=m125125-CONFIG_NETFILTER_XT_TARGET_TCPMSS=m126126-CONFIG_NETFILTER_XT_MATCH_CLUSTER=m127127-CONFIG_NETFILTER_XT_MATCH_COMMENT=m128128-CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m129129-CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m130130-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m131131-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m132132-CONFIG_NETFILTER_XT_MATCH_DSCP=m133133-CONFIG_NETFILTER_XT_MATCH_ESP=m134134-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m135135-CONFIG_NETFILTER_XT_MATCH_HELPER=m136136-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m137137-CONFIG_NETFILTER_XT_MATCH_LENGTH=m138138-CONFIG_NETFILTER_XT_MATCH_LIMIT=m139139-CONFIG_NETFILTER_XT_MATCH_MAC=m140140-CONFIG_NETFILTER_XT_MATCH_MARK=m141141-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m142142-CONFIG_NETFILTER_XT_MATCH_OSF=m143143-CONFIG_NETFILTER_XT_MATCH_OWNER=m144144-CONFIG_NETFILTER_XT_MATCH_POLICY=m145145-CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m146146-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m147147-CONFIG_NETFILTER_XT_MATCH_QUOTA=m148148-CONFIG_NETFILTER_XT_MATCH_RATEEST=m149149-CONFIG_NETFILTER_XT_MATCH_REALM=m150150-CONFIG_NETFILTER_XT_MATCH_RECENT=m151151-CONFIG_NETFILTER_XT_MATCH_SOCKET=m152152-CONFIG_NETFILTER_XT_MATCH_STATE=m153153-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m154154-CONFIG_NETFILTER_XT_MATCH_STRING=m155155-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m156156-CONFIG_NETFILTER_XT_MATCH_TIME=m157157-CONFIG_NETFILTER_XT_MATCH_U32=m158158-CONFIG_IP_VS=m159159-CONFIG_IP_VS_IPV6=y160160-CONFIG_IP_VS_PROTO_TCP=y161161-CONFIG_IP_VS_PROTO_UDP=y162162-CONFIG_IP_VS_PROTO_ESP=y163163-CONFIG_IP_VS_PROTO_AH=y164164-CONFIG_IP_VS_RR=m165165-CONFIG_IP_VS_WRR=m166166-CONFIG_IP_VS_LC=m167167-CONFIG_IP_VS_WLC=m168168-CONFIG_IP_VS_LBLC=m169169-CONFIG_IP_VS_LBLCR=m170170-CONFIG_IP_VS_DH=m171171-CONFIG_IP_VS_SH=m172172-CONFIG_IP_VS_SED=m173173-CONFIG_IP_VS_NQ=m174174-CONFIG_IP_NF_IPTABLES=m175175-CONFIG_IP_NF_MATCH_AH=m176176-CONFIG_IP_NF_MATCH_ECN=m177177-CONFIG_IP_NF_MATCH_TTL=m178178-CONFIG_IP_NF_FILTER=m179179-CONFIG_IP_NF_TARGET_REJECT=m180180-CONFIG_IP_NF_MANGLE=m181181-CONFIG_IP_NF_TARGET_CLUSTERIP=m182182-CONFIG_IP_NF_TARGET_ECN=m183183-CONFIG_IP_NF_TARGET_TTL=m184184-CONFIG_IP_NF_RAW=m185185-CONFIG_IP_NF_SECURITY=m186186-CONFIG_IP_NF_ARPTABLES=m187187-CONFIG_IP_NF_ARPFILTER=m188188-CONFIG_IP_NF_ARP_MANGLE=m189189-CONFIG_IP6_NF_MATCH_AH=m190190-CONFIG_IP6_NF_MATCH_EUI64=m191191-CONFIG_IP6_NF_MATCH_FRAG=m192192-CONFIG_IP6_NF_MATCH_OPTS=m193193-CONFIG_IP6_NF_MATCH_HL=m194194-CONFIG_IP6_NF_MATCH_IPV6HEADER=m195195-CONFIG_IP6_NF_MATCH_MH=m196196-CONFIG_IP6_NF_MATCH_RT=m197197-CONFIG_IP6_NF_TARGET_HL=m198198-CONFIG_IP6_NF_FILTER=m199199-CONFIG_IP6_NF_TARGET_REJECT=m200200-CONFIG_IP6_NF_MANGLE=m201201-CONFIG_IP6_NF_RAW=m202202-CONFIG_IP6_NF_SECURITY=m203203-CONFIG_DECNET_NF_GRABULATOR=m204204-CONFIG_BRIDGE_NF_EBTABLES=m205205-CONFIG_BRIDGE_EBT_BROUTE=m206206-CONFIG_BRIDGE_EBT_T_FILTER=m207207-CONFIG_BRIDGE_EBT_T_NAT=m208208-CONFIG_BRIDGE_EBT_802_3=m209209-CONFIG_BRIDGE_EBT_AMONG=m210210-CONFIG_BRIDGE_EBT_ARP=m211211-CONFIG_BRIDGE_EBT_IP=m212212-CONFIG_BRIDGE_EBT_IP6=m213213-CONFIG_BRIDGE_EBT_LIMIT=m214214-CONFIG_BRIDGE_EBT_MARK=m215215-CONFIG_BRIDGE_EBT_PKTTYPE=m216216-CONFIG_BRIDGE_EBT_STP=m217217-CONFIG_BRIDGE_EBT_VLAN=m218218-CONFIG_BRIDGE_EBT_ARPREPLY=m219219-CONFIG_BRIDGE_EBT_DNAT=m220220-CONFIG_BRIDGE_EBT_MARK_T=m221221-CONFIG_BRIDGE_EBT_REDIRECT=m222222-CONFIG_BRIDGE_EBT_SNAT=m223223-CONFIG_BRIDGE_EBT_LOG=m224224-CONFIG_BRIDGE_EBT_NFLOG=m225225-CONFIG_IP_DCCP=m226226-CONFIG_RDS=m227227-CONFIG_RDS_TCP=m228228-CONFIG_TIPC=m229229-CONFIG_ATM=m230230-CONFIG_ATM_CLIP=m231231-CONFIG_ATM_LANE=m232232-CONFIG_ATM_MPOA=m233233-CONFIG_ATM_BR2684=m234234-CONFIG_BRIDGE=m235235-CONFIG_VLAN_8021Q=m236236-CONFIG_VLAN_8021Q_GVRP=y237237-CONFIG_DECNET=m238238-CONFIG_LLC2=m239239-CONFIG_ATALK=m240240-CONFIG_DEV_APPLETALK=m241241-CONFIG_IPDDP=m242242-CONFIG_IPDDP_ENCAP=y243243-CONFIG_X25=m244244-CONFIG_LAPB=m245245-CONFIG_PHONET=m246246-CONFIG_IEEE802154=m247247-CONFIG_NET_SCHED=y248248-CONFIG_NET_SCH_CBQ=m249249-CONFIG_NET_SCH_HTB=m250250-CONFIG_NET_SCH_HFSC=m251251-CONFIG_NET_SCH_ATM=m252252-CONFIG_NET_SCH_PRIO=m253253-CONFIG_NET_SCH_MULTIQ=m254254-CONFIG_NET_SCH_RED=m255255-CONFIG_NET_SCH_SFQ=m256256-CONFIG_NET_SCH_TEQL=m257257-CONFIG_NET_SCH_TBF=m258258-CONFIG_NET_SCH_GRED=m259259-CONFIG_NET_SCH_DSMARK=m260260-CONFIG_NET_SCH_NETEM=m261261-CONFIG_NET_SCH_DRR=m262262-CONFIG_NET_SCH_INGRESS=m263263-CONFIG_NET_CLS_BASIC=m264264-CONFIG_NET_CLS_TCINDEX=m265265-CONFIG_NET_CLS_ROUTE4=m266266-CONFIG_NET_CLS_FW=m267267-CONFIG_NET_CLS_U32=m268268-CONFIG_CLS_U32_MARK=y269269-CONFIG_NET_CLS_RSVP=m270270-CONFIG_NET_CLS_RSVP6=m271271-CONFIG_NET_CLS_FLOW=m272272-CONFIG_NET_EMATCH=y273273-CONFIG_NET_EMATCH_CMP=m274274-CONFIG_NET_EMATCH_NBYTE=m275275-CONFIG_NET_EMATCH_U32=m276276-CONFIG_NET_EMATCH_META=m277277-CONFIG_NET_EMATCH_TEXT=m278278-CONFIG_NET_CLS_ACT=y279279-CONFIG_NET_ACT_POLICE=m280280-CONFIG_NET_ACT_GACT=m281281-CONFIG_GACT_PROB=y282282-CONFIG_NET_ACT_MIRRED=m283283-CONFIG_NET_ACT_IPT=m284284-CONFIG_NET_ACT_NAT=m285285-CONFIG_NET_ACT_PEDIT=m286286-CONFIG_NET_ACT_SIMP=m287287-CONFIG_NET_ACT_SKBEDIT=m288288-CONFIG_DCB=y289289-CONFIG_NET_PKTGEN=m290290-CONFIG_DEVTMPFS=y291291-CONFIG_DEVTMPFS_MOUNT=y292292-# CONFIG_STANDALONE is not set293293-CONFIG_CONNECTOR=y294294-CONFIG_MTD=y295295-CONFIG_MTD_CMDLINE_PARTS=y296296-CONFIG_MTD_BLOCK=y297297-CONFIG_MTD_CFI=y298298-CONFIG_MTD_CFI_ADV_OPTIONS=y299299-CONFIG_MTD_CFI_LE_BYTE_SWAP=y300300-CONFIG_MTD_CFI_GEOMETRY=y301301-CONFIG_MTD_CFI_INTELEXT=y302302-CONFIG_MTD_PHYSMAP=y303303-CONFIG_MTD_PHYSMAP_OF=y304304-CONFIG_BLK_DEV_LOOP=y305305-CONFIG_BLK_DEV_CRYPTOLOOP=m306306-CONFIG_BLK_DEV_NBD=m307307-CONFIG_BLK_DEV_RAM=y308308-CONFIG_BLK_DEV_RAM_SIZE=65536309309-CONFIG_CDROM_PKTCDVD=y310310-CONFIG_RAID_ATTRS=m311311-CONFIG_BLK_DEV_SD=y312312-CONFIG_CHR_DEV_ST=m313313-CONFIG_CHR_DEV_OSST=m314314-CONFIG_BLK_DEV_SR=y315315-CONFIG_CHR_DEV_SG=y316316-CONFIG_CHR_DEV_SCH=m317317-CONFIG_SCSI_CONSTANTS=y318318-CONFIG_SCSI_LOGGING=y319319-CONFIG_SCSI_SCAN_ASYNC=y320320-CONFIG_SCSI_SPI_ATTRS=m321321-CONFIG_SCSI_SAS_LIBSAS=m322322-CONFIG_SCSI_SRP_ATTRS=m323323-CONFIG_ISCSI_TCP=m324324-CONFIG_SCSI_DEBUG=m325325-CONFIG_SCSI_DH=y326326-CONFIG_SCSI_DH_RDAC=m327327-CONFIG_SCSI_DH_HP_SW=m328328-CONFIG_SCSI_DH_EMC=m329329-CONFIG_SCSI_DH_ALUA=m330330-CONFIG_SCSI_OSD_INITIATOR=m331331-CONFIG_SCSI_OSD_ULD=m332332-CONFIG_ATA=y333333-CONFIG_SATA_AHCI=y334334-CONFIG_SATA_SIL24=y335335-# CONFIG_ATA_SFF is not set336336-CONFIG_NETDEVICES=y337337-# CONFIG_NET_VENDOR_3COM is not set338338-# CONFIG_NET_VENDOR_ADAPTEC is not set339339-# CONFIG_NET_VENDOR_ALTEON is not set340340-# CONFIG_NET_VENDOR_AMD is not set341341-# CONFIG_NET_VENDOR_ATHEROS is not set342342-# CONFIG_NET_VENDOR_BROADCOM is not set343343-# CONFIG_NET_VENDOR_BROCADE is not set344344-# CONFIG_NET_VENDOR_CHELSIO is not set345345-# CONFIG_NET_VENDOR_DEC is not set346346-# CONFIG_NET_VENDOR_DLINK is not set347347-# CONFIG_NET_VENDOR_EMULEX is not set348348-# CONFIG_NET_VENDOR_HP is not set349349-# CONFIG_NET_VENDOR_I825XX is not set350350-CONFIG_E1000E=y351351-CONFIG_SKY2=y352352-# CONFIG_NET_VENDOR_MELLANOX is not set353353-# CONFIG_NET_VENDOR_MICREL is not set354354-# CONFIG_NET_VENDOR_MYRI is not set355355-# CONFIG_NET_VENDOR_NATSEMI is not set356356-# CONFIG_NET_VENDOR_NVIDIA is not set357357-# CONFIG_NET_VENDOR_OKI is not set358358-# CONFIG_NET_VENDOR_QLOGIC is not set359359-# CONFIG_NET_VENDOR_RDC is not set360360-# CONFIG_NET_VENDOR_REALTEK is not set361361-# CONFIG_NET_VENDOR_SEEQ is not set362362-# CONFIG_NET_VENDOR_SILAN is not set363363-# CONFIG_NET_VENDOR_SIS is not set364364-# CONFIG_NET_VENDOR_SMSC is not set365365-# CONFIG_NET_VENDOR_STMICRO is not set366366-# CONFIG_NET_VENDOR_SUN is not set367367-# CONFIG_NET_VENDOR_TEHUTI is not set368368-# CONFIG_NET_VENDOR_TI is not set369369-# CONFIG_NET_VENDOR_TOSHIBA is not set370370-# CONFIG_NET_VENDOR_VIA is not set371371-# CONFIG_NET_VENDOR_WIZNET is not set372372-CONFIG_INPUT_EVDEV=y373373-CONFIG_INPUT_EVBUG=m374374-# CONFIG_INPUT_KEYBOARD is not set375375-# CONFIG_INPUT_MOUSE is not set376376-CONFIG_SERIO_SERPORT=m377377-CONFIG_SERIO_LIBPS2=y378378-CONFIG_SERIO_RAW=m379379-CONFIG_VT_HW_CONSOLE_BINDING=y380380-CONFIG_LEGACY_PTY_COUNT=0381381-CONFIG_SERIAL_NONSTANDARD=y382382-CONFIG_N_HDLC=m383383-CONFIG_SERIAL_8250=y384384-CONFIG_SERIAL_8250_CONSOLE=y385385-CONFIG_SERIAL_8250_NR_UARTS=48386386-CONFIG_SERIAL_8250_EXTENDED=y387387-CONFIG_SERIAL_8250_MANY_PORTS=y388388-CONFIG_SERIAL_8250_SHARE_IRQ=y389389-CONFIG_SERIAL_8250_RSA=y390390-CONFIG_SERIAL_OF_PLATFORM=y391391-CONFIG_HW_RANDOM=y392392-CONFIG_HW_RANDOM_TIMERIOMEM=m393393-CONFIG_RAW_DRIVER=m394394-CONFIG_I2C=y395395-CONFIG_I2C_CHARDEV=y396396-CONFIG_I2C_OCORES=y397397-CONFIG_SENSORS_LM90=y398398-CONFIG_THERMAL=y399399-# CONFIG_VGA_CONSOLE is not set400400-# CONFIG_USB_SUPPORT is not set401401-CONFIG_RTC_CLASS=y402402-CONFIG_RTC_DRV_DS1374=y403403-CONFIG_UIO=y404404-CONFIG_UIO_PDRV_GENIRQ=m405405-# CONFIG_IOMMU_SUPPORT is not set406406-CONFIG_EXT2_FS=y407407-CONFIG_EXT2_FS_XATTR=y408408-CONFIG_EXT2_FS_POSIX_ACL=y409409-CONFIG_EXT2_FS_SECURITY=y410410-CONFIG_EXT3_FS=y411411-CONFIG_EXT3_FS_POSIX_ACL=y412412-CONFIG_EXT3_FS_SECURITY=y413413-CONFIG_GFS2_FS=m414414-CONFIG_BTRFS_FS=m415415-CONFIG_BTRFS_FS_POSIX_ACL=y416416-CONFIG_NILFS2_FS=m417417-CONFIG_QUOTA_NETLINK_INTERFACE=y418418-CONFIG_AUTOFS4_FS=m419419-CONFIG_FUSE_FS=y420420-CONFIG_CUSE=m421421-CONFIG_FSCACHE=m422422-CONFIG_FSCACHE_STATS=y423423-CONFIG_FSCACHE_HISTOGRAM=y424424-CONFIG_CACHEFILES=m425425-CONFIG_ISO9660_FS=m426426-CONFIG_JOLIET=y427427-CONFIG_ZISOFS=y428428-CONFIG_UDF_FS=m429429-CONFIG_MSDOS_FS=m430430-CONFIG_VFAT_FS=m431431-CONFIG_NTFS_FS=m432432-CONFIG_PROC_KCORE=y433433-CONFIG_TMPFS=y434434-CONFIG_TMPFS_POSIX_ACL=y435435-CONFIG_ADFS_FS=m436436-CONFIG_AFFS_FS=m437437-CONFIG_ECRYPT_FS=y438438-CONFIG_HFS_FS=m439439-CONFIG_HFSPLUS_FS=m440440-CONFIG_BEFS_FS=m441441-CONFIG_BFS_FS=m442442-CONFIG_EFS_FS=m443443-CONFIG_JFFS2_FS=y444444-CONFIG_CRAMFS=m445445-CONFIG_SQUASHFS=m446446-CONFIG_VXFS_FS=m447447-CONFIG_MINIX_FS=m448448-CONFIG_OMFS_FS=m449449-CONFIG_HPFS_FS=m450450-CONFIG_QNX4FS_FS=m451451-CONFIG_ROMFS_FS=m452452-CONFIG_SYSV_FS=m453453-CONFIG_UFS_FS=m454454-CONFIG_EXOFS_FS=m455455-CONFIG_NFS_FS=m456456-CONFIG_NFS_V3_ACL=y457457-CONFIG_NFS_V4=m458458-CONFIG_NFS_FSCACHE=y459459-CONFIG_NFSD=m460460-CONFIG_NFSD_V3_ACL=y461461-CONFIG_NFSD_V4=y462462-CONFIG_CIFS=m463463-CONFIG_CIFS_WEAK_PW_HASH=y464464-CONFIG_CIFS_UPCALL=y465465-CONFIG_CIFS_XATTR=y466466-CONFIG_CIFS_POSIX=y467467-CONFIG_CIFS_DFS_UPCALL=y468468-CONFIG_CODA_FS=m469469-CONFIG_AFS_FS=m470470-CONFIG_NLS=y471471-CONFIG_NLS_DEFAULT="cp437"472472-CONFIG_NLS_CODEPAGE_437=m473473-CONFIG_NLS_CODEPAGE_737=m474474-CONFIG_NLS_CODEPAGE_775=m475475-CONFIG_NLS_CODEPAGE_850=m476476-CONFIG_NLS_CODEPAGE_852=m477477-CONFIG_NLS_CODEPAGE_855=m478478-CONFIG_NLS_CODEPAGE_857=m479479-CONFIG_NLS_CODEPAGE_860=m480480-CONFIG_NLS_CODEPAGE_861=m481481-CONFIG_NLS_CODEPAGE_862=m482482-CONFIG_NLS_CODEPAGE_863=m483483-CONFIG_NLS_CODEPAGE_864=m484484-CONFIG_NLS_CODEPAGE_865=m485485-CONFIG_NLS_CODEPAGE_866=m486486-CONFIG_NLS_CODEPAGE_869=m487487-CONFIG_NLS_CODEPAGE_936=m488488-CONFIG_NLS_CODEPAGE_950=m489489-CONFIG_NLS_CODEPAGE_932=m490490-CONFIG_NLS_CODEPAGE_949=m491491-CONFIG_NLS_CODEPAGE_874=m492492-CONFIG_NLS_ISO8859_8=m493493-CONFIG_NLS_CODEPAGE_1250=m494494-CONFIG_NLS_CODEPAGE_1251=m495495-CONFIG_NLS_ASCII=m496496-CONFIG_NLS_ISO8859_1=m497497-CONFIG_NLS_ISO8859_2=m498498-CONFIG_NLS_ISO8859_3=m499499-CONFIG_NLS_ISO8859_4=m500500-CONFIG_NLS_ISO8859_5=m501501-CONFIG_NLS_ISO8859_6=m502502-CONFIG_NLS_ISO8859_7=m503503-CONFIG_NLS_ISO8859_9=m504504-CONFIG_NLS_ISO8859_13=m505505-CONFIG_NLS_ISO8859_14=m506506-CONFIG_NLS_ISO8859_15=m507507-CONFIG_NLS_KOI8_R=m508508-CONFIG_NLS_KOI8_U=m509509-CONFIG_SECURITY=y510510-CONFIG_LSM_MMAP_MIN_ADDR=0511511-CONFIG_SECURITY_SELINUX=y512512-CONFIG_SECURITY_SELINUX_BOOTPARAM=y513513-CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0514514-CONFIG_SECURITY_SELINUX_DISABLE=y515515-CONFIG_SECURITY_SMACK=y516516-CONFIG_SECURITY_TOMOYO=y517517-CONFIG_CRYPTO_CRYPTD=m518518-CONFIG_CRYPTO_TEST=m519519-CONFIG_CRYPTO_GCM=m520520-CONFIG_CRYPTO_CTS=m521521-CONFIG_CRYPTO_LRW=m522522-CONFIG_CRYPTO_PCBC=m523523-CONFIG_CRYPTO_XTS=m524524-CONFIG_CRYPTO_HMAC=y525525-CONFIG_CRYPTO_XCBC=m526526-CONFIG_CRYPTO_VMAC=m527527-CONFIG_CRYPTO_MICHAEL_MIC=m528528-CONFIG_CRYPTO_RMD128=m529529-CONFIG_CRYPTO_RMD160=m530530-CONFIG_CRYPTO_RMD256=m531531-CONFIG_CRYPTO_RMD320=m532532-CONFIG_CRYPTO_TGR192=m533533-CONFIG_CRYPTO_WP512=m534534-CONFIG_CRYPTO_ANUBIS=m535535-CONFIG_CRYPTO_BLOWFISH=m536536-CONFIG_CRYPTO_CAMELLIA=m537537-CONFIG_CRYPTO_CAST5=m538538-CONFIG_CRYPTO_CAST6=m539539-CONFIG_CRYPTO_FCRYPT=m540540-CONFIG_CRYPTO_KHAZAD=m541541-CONFIG_CRYPTO_SALSA20=m542542-CONFIG_CRYPTO_SEED=m543543-CONFIG_CRYPTO_SERPENT=m544544-CONFIG_CRYPTO_TEA=m545545-CONFIG_CRYPTO_TWOFISH=m546546-CONFIG_CRYPTO_LZO=m547547-CONFIG_CRC7=m548548-CONFIG_PRINTK_TIME=y549549-CONFIG_DEBUG_INFO=y550550-# CONFIG_ENABLE_MUST_CHECK is not set551551-CONFIG_FRAME_WARN=1024552552-CONFIG_DEBUG_MEMORY_INIT=y553553-CONFIG_DETECT_HUNG_TASK=y554554-CONFIG_SCHEDSTATS=y555555-CONFIG_SCHED_TRACER=y556556-CONFIG_BLK_DEV_IO_TRACE=y557557-CONFIG_KGDB=y
-508
arch/mips/configs/nlm_xlr_defconfig
···11-# CONFIG_LOCALVERSION_AUTO is not set22-CONFIG_SYSVIPC=y33-CONFIG_POSIX_MQUEUE=y44-CONFIG_AUDIT=y55-CONFIG_NO_HZ=y66-CONFIG_HIGH_RES_TIMERS=y77-CONFIG_PREEMPT_VOLUNTARY=y88-CONFIG_BSD_PROCESS_ACCT=y99-CONFIG_BSD_PROCESS_ACCT_V3=y1010-CONFIG_TASKSTATS=y1111-CONFIG_TASK_DELAY_ACCT=y1212-CONFIG_TASK_XACCT=y1313-CONFIG_TASK_IO_ACCOUNTING=y1414-CONFIG_NAMESPACES=y1515-CONFIG_SCHED_AUTOGROUP=y1616-CONFIG_BLK_DEV_INITRD=y1717-CONFIG_EXPERT=y1818-# CONFIG_ELF_CORE is not set1919-CONFIG_KALLSYMS_ALL=y2020-# CONFIG_PERF_EVENTS is not set2121-# CONFIG_COMPAT_BRK is not set2222-CONFIG_PROFILING=y2323-CONFIG_NLM_XLR_BOARD=y2424-CONFIG_HIGHMEM=y2525-CONFIG_SMP=y2626-CONFIG_KEXEC=y2727-CONFIG_PCI=y2828-CONFIG_PCI_MSI=y2929-CONFIG_PCI_DEBUG=y3030-CONFIG_PM=y3131-CONFIG_PM_DEBUG=y3232-CONFIG_MODULES=y3333-CONFIG_MODULE_UNLOAD=y3434-CONFIG_MODVERSIONS=y3535-CONFIG_MODULE_SRCVERSION_ALL=y3636-CONFIG_BLK_DEV_INTEGRITY=y3737-CONFIG_PARTITION_ADVANCED=y3838-CONFIG_ACORN_PARTITION=y3939-CONFIG_ACORN_PARTITION_ICS=y4040-CONFIG_ACORN_PARTITION_RISCIX=y4141-CONFIG_OSF_PARTITION=y4242-CONFIG_AMIGA_PARTITION=y4343-CONFIG_ATARI_PARTITION=y4444-CONFIG_MAC_PARTITION=y4545-CONFIG_BSD_DISKLABEL=y4646-CONFIG_MINIX_SUBPARTITION=y4747-CONFIG_SOLARIS_X86_PARTITION=y4848-CONFIG_UNIXWARE_DISKLABEL=y4949-CONFIG_LDM_PARTITION=y5050-CONFIG_SGI_PARTITION=y5151-CONFIG_ULTRIX_PARTITION=y5252-CONFIG_SUN_PARTITION=y5353-CONFIG_KARMA_PARTITION=y5454-CONFIG_SYSV68_PARTITION=y5555-CONFIG_BINFMT_MISC=m5656-CONFIG_KSM=y5757-CONFIG_DEFAULT_MMAP_MIN_ADDR=655365858-CONFIG_NET=y5959-CONFIG_PACKET=y6060-CONFIG_UNIX=y6161-CONFIG_XFRM_USER=m6262-CONFIG_NET_KEY=m6363-CONFIG_INET=y6464-CONFIG_IP_MULTICAST=y6565-CONFIG_IP_ADVANCED_ROUTER=y6666-CONFIG_IP_MULTIPLE_TABLES=y6767-CONFIG_IP_ROUTE_MULTIPATH=y6868-CONFIG_IP_ROUTE_VERBOSE=y6969-CONFIG_NET_IPIP=m7070-CONFIG_IP_MROUTE=y7171-CONFIG_IP_PIMSM_V1=y7272-CONFIG_IP_PIMSM_V2=y7373-CONFIG_SYN_COOKIES=y7474-CONFIG_INET_AH=m7575-CONFIG_INET_ESP=m7676-CONFIG_INET_IPCOMP=m7777-CONFIG_INET_XFRM_MODE_TRANSPORT=m7878-CONFIG_INET_XFRM_MODE_TUNNEL=m7979-CONFIG_INET_XFRM_MODE_BEET=m8080-CONFIG_TCP_CONG_ADVANCED=y8181-CONFIG_TCP_CONG_HSTCP=m8282-CONFIG_TCP_CONG_HYBLA=m8383-CONFIG_TCP_CONG_SCALABLE=m8484-CONFIG_TCP_CONG_LP=m8585-CONFIG_TCP_CONG_VENO=m8686-CONFIG_TCP_CONG_YEAH=m8787-CONFIG_TCP_CONG_ILLINOIS=m8888-CONFIG_TCP_MD5SIG=y8989-CONFIG_INET6_AH=m9090-CONFIG_INET6_ESP=m9191-CONFIG_INET6_IPCOMP=m9292-CONFIG_INET6_XFRM_MODE_TRANSPORT=m9393-CONFIG_INET6_XFRM_MODE_TUNNEL=m9494-CONFIG_INET6_XFRM_MODE_BEET=m9595-CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m9696-CONFIG_IPV6_SIT=m9797-CONFIG_IPV6_TUNNEL=m9898-CONFIG_IPV6_MULTIPLE_TABLES=y9999-CONFIG_NETFILTER=y100100-CONFIG_NF_CONNTRACK=m101101-CONFIG_NF_CONNTRACK_SECMARK=y102102-CONFIG_NF_CONNTRACK_EVENTS=y103103-CONFIG_NF_CONNTRACK_AMANDA=m104104-CONFIG_NF_CONNTRACK_FTP=m105105-CONFIG_NF_CONNTRACK_H323=m106106-CONFIG_NF_CONNTRACK_IRC=m107107-CONFIG_NF_CONNTRACK_NETBIOS_NS=m108108-CONFIG_NF_CONNTRACK_PPTP=m109109-CONFIG_NF_CONNTRACK_SANE=m110110-CONFIG_NF_CONNTRACK_SIP=m111111-CONFIG_NF_CONNTRACK_TFTP=m112112-CONFIG_NF_CT_NETLINK=m113113-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m114114-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m115115-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m116116-CONFIG_NETFILTER_XT_TARGET_DSCP=m117117-CONFIG_NETFILTER_XT_TARGET_MARK=m118118-CONFIG_NETFILTER_XT_TARGET_NFLOG=m119119-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m120120-CONFIG_NETFILTER_XT_TARGET_TPROXY=m121121-CONFIG_NETFILTER_XT_TARGET_TRACE=m122122-CONFIG_NETFILTER_XT_TARGET_SECMARK=m123123-CONFIG_NETFILTER_XT_TARGET_TCPMSS=m124124-CONFIG_NETFILTER_XT_MATCH_CLUSTER=m125125-CONFIG_NETFILTER_XT_MATCH_COMMENT=m126126-CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m127127-CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m128128-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m129129-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m130130-CONFIG_NETFILTER_XT_MATCH_DSCP=m131131-CONFIG_NETFILTER_XT_MATCH_ESP=m132132-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m133133-CONFIG_NETFILTER_XT_MATCH_HELPER=m134134-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m135135-CONFIG_NETFILTER_XT_MATCH_LENGTH=m136136-CONFIG_NETFILTER_XT_MATCH_LIMIT=m137137-CONFIG_NETFILTER_XT_MATCH_MAC=m138138-CONFIG_NETFILTER_XT_MATCH_MARK=m139139-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m140140-CONFIG_NETFILTER_XT_MATCH_OSF=m141141-CONFIG_NETFILTER_XT_MATCH_OWNER=m142142-CONFIG_NETFILTER_XT_MATCH_POLICY=m143143-CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m144144-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m145145-CONFIG_NETFILTER_XT_MATCH_QUOTA=m146146-CONFIG_NETFILTER_XT_MATCH_RATEEST=m147147-CONFIG_NETFILTER_XT_MATCH_REALM=m148148-CONFIG_NETFILTER_XT_MATCH_RECENT=m149149-CONFIG_NETFILTER_XT_MATCH_SOCKET=m150150-CONFIG_NETFILTER_XT_MATCH_STATE=m151151-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m152152-CONFIG_NETFILTER_XT_MATCH_STRING=m153153-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m154154-CONFIG_NETFILTER_XT_MATCH_TIME=m155155-CONFIG_NETFILTER_XT_MATCH_U32=m156156-CONFIG_IP_VS=m157157-CONFIG_IP_VS_IPV6=y158158-CONFIG_IP_VS_PROTO_TCP=y159159-CONFIG_IP_VS_PROTO_UDP=y160160-CONFIG_IP_VS_PROTO_ESP=y161161-CONFIG_IP_VS_PROTO_AH=y162162-CONFIG_IP_VS_RR=m163163-CONFIG_IP_VS_WRR=m164164-CONFIG_IP_VS_LC=m165165-CONFIG_IP_VS_WLC=m166166-CONFIG_IP_VS_LBLC=m167167-CONFIG_IP_VS_LBLCR=m168168-CONFIG_IP_VS_DH=m169169-CONFIG_IP_VS_SH=m170170-CONFIG_IP_VS_SED=m171171-CONFIG_IP_VS_NQ=m172172-CONFIG_IP_NF_IPTABLES=m173173-CONFIG_IP_NF_MATCH_AH=m174174-CONFIG_IP_NF_MATCH_ECN=m175175-CONFIG_IP_NF_MATCH_TTL=m176176-CONFIG_IP_NF_FILTER=m177177-CONFIG_IP_NF_TARGET_REJECT=m178178-CONFIG_IP_NF_MANGLE=m179179-CONFIG_IP_NF_TARGET_CLUSTERIP=m180180-CONFIG_IP_NF_TARGET_ECN=m181181-CONFIG_IP_NF_TARGET_TTL=m182182-CONFIG_IP_NF_RAW=m183183-CONFIG_IP_NF_SECURITY=m184184-CONFIG_IP_NF_ARPTABLES=m185185-CONFIG_IP_NF_ARPFILTER=m186186-CONFIG_IP_NF_ARP_MANGLE=m187187-CONFIG_IP6_NF_MATCH_AH=m188188-CONFIG_IP6_NF_MATCH_EUI64=m189189-CONFIG_IP6_NF_MATCH_FRAG=m190190-CONFIG_IP6_NF_MATCH_OPTS=m191191-CONFIG_IP6_NF_MATCH_HL=m192192-CONFIG_IP6_NF_MATCH_IPV6HEADER=m193193-CONFIG_IP6_NF_MATCH_MH=m194194-CONFIG_IP6_NF_MATCH_RT=m195195-CONFIG_IP6_NF_TARGET_HL=m196196-CONFIG_IP6_NF_FILTER=m197197-CONFIG_IP6_NF_TARGET_REJECT=m198198-CONFIG_IP6_NF_MANGLE=m199199-CONFIG_IP6_NF_RAW=m200200-CONFIG_IP6_NF_SECURITY=m201201-CONFIG_DECNET_NF_GRABULATOR=m202202-CONFIG_BRIDGE_NF_EBTABLES=m203203-CONFIG_BRIDGE_EBT_BROUTE=m204204-CONFIG_BRIDGE_EBT_T_FILTER=m205205-CONFIG_BRIDGE_EBT_T_NAT=m206206-CONFIG_BRIDGE_EBT_802_3=m207207-CONFIG_BRIDGE_EBT_AMONG=m208208-CONFIG_BRIDGE_EBT_ARP=m209209-CONFIG_BRIDGE_EBT_IP=m210210-CONFIG_BRIDGE_EBT_IP6=m211211-CONFIG_BRIDGE_EBT_LIMIT=m212212-CONFIG_BRIDGE_EBT_MARK=m213213-CONFIG_BRIDGE_EBT_PKTTYPE=m214214-CONFIG_BRIDGE_EBT_STP=m215215-CONFIG_BRIDGE_EBT_VLAN=m216216-CONFIG_BRIDGE_EBT_ARPREPLY=m217217-CONFIG_BRIDGE_EBT_DNAT=m218218-CONFIG_BRIDGE_EBT_MARK_T=m219219-CONFIG_BRIDGE_EBT_REDIRECT=m220220-CONFIG_BRIDGE_EBT_SNAT=m221221-CONFIG_BRIDGE_EBT_LOG=m222222-CONFIG_BRIDGE_EBT_NFLOG=m223223-CONFIG_IP_DCCP=m224224-CONFIG_RDS=m225225-CONFIG_RDS_TCP=m226226-CONFIG_TIPC=m227227-CONFIG_ATM=m228228-CONFIG_ATM_CLIP=m229229-CONFIG_ATM_LANE=m230230-CONFIG_ATM_MPOA=m231231-CONFIG_ATM_BR2684=m232232-CONFIG_BRIDGE=m233233-CONFIG_VLAN_8021Q=m234234-CONFIG_VLAN_8021Q_GVRP=y235235-CONFIG_DECNET=m236236-CONFIG_LLC2=m237237-CONFIG_ATALK=m238238-CONFIG_DEV_APPLETALK=m239239-CONFIG_IPDDP=m240240-CONFIG_IPDDP_ENCAP=y241241-CONFIG_X25=m242242-CONFIG_LAPB=m243243-CONFIG_PHONET=m244244-CONFIG_IEEE802154=m245245-CONFIG_NET_SCHED=y246246-CONFIG_NET_SCH_CBQ=m247247-CONFIG_NET_SCH_HTB=m248248-CONFIG_NET_SCH_HFSC=m249249-CONFIG_NET_SCH_ATM=m250250-CONFIG_NET_SCH_PRIO=m251251-CONFIG_NET_SCH_MULTIQ=m252252-CONFIG_NET_SCH_RED=m253253-CONFIG_NET_SCH_SFQ=m254254-CONFIG_NET_SCH_TEQL=m255255-CONFIG_NET_SCH_TBF=m256256-CONFIG_NET_SCH_GRED=m257257-CONFIG_NET_SCH_DSMARK=m258258-CONFIG_NET_SCH_NETEM=m259259-CONFIG_NET_SCH_DRR=m260260-CONFIG_NET_SCH_INGRESS=m261261-CONFIG_NET_CLS_BASIC=m262262-CONFIG_NET_CLS_TCINDEX=m263263-CONFIG_NET_CLS_ROUTE4=m264264-CONFIG_NET_CLS_FW=m265265-CONFIG_NET_CLS_U32=m266266-CONFIG_CLS_U32_MARK=y267267-CONFIG_NET_CLS_RSVP=m268268-CONFIG_NET_CLS_RSVP6=m269269-CONFIG_NET_CLS_FLOW=m270270-CONFIG_NET_EMATCH=y271271-CONFIG_NET_EMATCH_CMP=m272272-CONFIG_NET_EMATCH_NBYTE=m273273-CONFIG_NET_EMATCH_U32=m274274-CONFIG_NET_EMATCH_META=m275275-CONFIG_NET_EMATCH_TEXT=m276276-CONFIG_NET_CLS_ACT=y277277-CONFIG_NET_ACT_POLICE=m278278-CONFIG_NET_ACT_GACT=m279279-CONFIG_GACT_PROB=y280280-CONFIG_NET_ACT_MIRRED=m281281-CONFIG_NET_ACT_IPT=m282282-CONFIG_NET_ACT_NAT=m283283-CONFIG_NET_ACT_PEDIT=m284284-CONFIG_NET_ACT_SIMP=m285285-CONFIG_NET_ACT_SKBEDIT=m286286-CONFIG_DCB=y287287-CONFIG_NET_PKTGEN=m288288-CONFIG_DEVTMPFS=y289289-CONFIG_DEVTMPFS_MOUNT=y290290-# CONFIG_STANDALONE is not set291291-CONFIG_CONNECTOR=y292292-CONFIG_BLK_DEV_LOOP=y293293-CONFIG_BLK_DEV_CRYPTOLOOP=m294294-CONFIG_BLK_DEV_NBD=m295295-CONFIG_BLK_DEV_RAM=y296296-CONFIG_BLK_DEV_RAM_SIZE=65536297297-CONFIG_CDROM_PKTCDVD=y298298-CONFIG_RAID_ATTRS=m299299-CONFIG_SCSI=y300300-CONFIG_BLK_DEV_SD=y301301-CONFIG_CHR_DEV_ST=m302302-CONFIG_CHR_DEV_OSST=m303303-CONFIG_BLK_DEV_SR=y304304-CONFIG_CHR_DEV_SG=y305305-CONFIG_CHR_DEV_SCH=m306306-CONFIG_SCSI_CONSTANTS=y307307-CONFIG_SCSI_LOGGING=y308308-CONFIG_SCSI_SCAN_ASYNC=y309309-CONFIG_SCSI_SPI_ATTRS=m310310-CONFIG_SCSI_SAS_LIBSAS=m311311-CONFIG_SCSI_SRP_ATTRS=m312312-CONFIG_ISCSI_TCP=m313313-CONFIG_SCSI_DEBUG=m314314-CONFIG_SCSI_DH=y315315-CONFIG_SCSI_DH_RDAC=m316316-CONFIG_SCSI_DH_HP_SW=m317317-CONFIG_SCSI_DH_EMC=m318318-CONFIG_SCSI_DH_ALUA=m319319-CONFIG_SCSI_OSD_INITIATOR=m320320-CONFIG_SCSI_OSD_ULD=m321321-CONFIG_NETDEVICES=y322322-CONFIG_E1000E=y323323-CONFIG_SKY2=y324324-CONFIG_INPUT_EVDEV=y325325-CONFIG_INPUT_EVBUG=m326326-# CONFIG_INPUT_KEYBOARD is not set327327-# CONFIG_INPUT_MOUSE is not set328328-CONFIG_SERIO_SERPORT=m329329-CONFIG_SERIO_LIBPS2=y330330-CONFIG_SERIO_RAW=m331331-CONFIG_VT_HW_CONSOLE_BINDING=y332332-CONFIG_LEGACY_PTY_COUNT=0333333-CONFIG_SERIAL_NONSTANDARD=y334334-CONFIG_N_HDLC=m335335-CONFIG_SERIAL_8250=y336336-CONFIG_SERIAL_8250_CONSOLE=y337337-CONFIG_SERIAL_8250_NR_UARTS=48338338-CONFIG_SERIAL_8250_EXTENDED=y339339-CONFIG_SERIAL_8250_MANY_PORTS=y340340-CONFIG_SERIAL_8250_SHARE_IRQ=y341341-CONFIG_SERIAL_8250_RSA=y342342-CONFIG_HW_RANDOM=y343343-CONFIG_HW_RANDOM_TIMERIOMEM=m344344-CONFIG_RAW_DRIVER=m345345-CONFIG_I2C=y346346-CONFIG_I2C_XLR=y347347-# CONFIG_HWMON is not set348348-# CONFIG_VGA_CONSOLE is not set349349-# CONFIG_USB_SUPPORT is not set350350-CONFIG_RTC_CLASS=y351351-CONFIG_RTC_DRV_DS1374=y352352-CONFIG_UIO=y353353-CONFIG_UIO_PDRV_GENIRQ=m354354-CONFIG_EXT2_FS=y355355-CONFIG_EXT2_FS_XATTR=y356356-CONFIG_EXT2_FS_POSIX_ACL=y357357-CONFIG_EXT2_FS_SECURITY=y358358-CONFIG_EXT3_FS=y359359-CONFIG_EXT3_FS_POSIX_ACL=y360360-CONFIG_EXT3_FS_SECURITY=y361361-CONFIG_GFS2_FS=m362362-CONFIG_OCFS2_FS=m363363-CONFIG_BTRFS_FS=m364364-CONFIG_BTRFS_FS_POSIX_ACL=y365365-CONFIG_NILFS2_FS=m366366-CONFIG_QUOTA_NETLINK_INTERFACE=y367367-# CONFIG_PRINT_QUOTA_WARNING is not set368368-CONFIG_QFMT_V1=m369369-CONFIG_QFMT_V2=m370370-CONFIG_AUTOFS4_FS=m371371-CONFIG_FUSE_FS=y372372-CONFIG_CUSE=m373373-CONFIG_FSCACHE=m374374-CONFIG_FSCACHE_STATS=y375375-CONFIG_FSCACHE_HISTOGRAM=y376376-CONFIG_CACHEFILES=m377377-CONFIG_ISO9660_FS=m378378-CONFIG_JOLIET=y379379-CONFIG_ZISOFS=y380380-CONFIG_UDF_FS=m381381-CONFIG_MSDOS_FS=m382382-CONFIG_VFAT_FS=m383383-CONFIG_NTFS_FS=m384384-CONFIG_PROC_KCORE=y385385-CONFIG_TMPFS=y386386-CONFIG_TMPFS_POSIX_ACL=y387387-CONFIG_CONFIGFS_FS=y388388-CONFIG_ADFS_FS=m389389-CONFIG_AFFS_FS=m390390-CONFIG_ECRYPT_FS=y391391-CONFIG_HFS_FS=m392392-CONFIG_HFSPLUS_FS=m393393-CONFIG_BEFS_FS=m394394-CONFIG_BFS_FS=m395395-CONFIG_EFS_FS=m396396-CONFIG_CRAMFS=m397397-CONFIG_SQUASHFS=m398398-CONFIG_VXFS_FS=m399399-CONFIG_MINIX_FS=m400400-CONFIG_OMFS_FS=m401401-CONFIG_HPFS_FS=m402402-CONFIG_QNX4FS_FS=m403403-CONFIG_ROMFS_FS=m404404-CONFIG_SYSV_FS=m405405-CONFIG_UFS_FS=m406406-CONFIG_EXOFS_FS=m407407-CONFIG_NFS_FS=m408408-CONFIG_NFS_V3_ACL=y409409-CONFIG_NFS_V4=m410410-CONFIG_NFS_FSCACHE=y411411-CONFIG_NFSD=m412412-CONFIG_NFSD_V3_ACL=y413413-CONFIG_NFSD_V4=y414414-CONFIG_CIFS=m415415-CONFIG_CIFS_WEAK_PW_HASH=y416416-CONFIG_CIFS_UPCALL=y417417-CONFIG_CIFS_XATTR=y418418-CONFIG_CIFS_POSIX=y419419-CONFIG_CIFS_DFS_UPCALL=y420420-CONFIG_CODA_FS=m421421-CONFIG_AFS_FS=m422422-CONFIG_NLS=y423423-CONFIG_NLS_DEFAULT="cp437"424424-CONFIG_NLS_CODEPAGE_437=m425425-CONFIG_NLS_CODEPAGE_737=m426426-CONFIG_NLS_CODEPAGE_775=m427427-CONFIG_NLS_CODEPAGE_850=m428428-CONFIG_NLS_CODEPAGE_852=m429429-CONFIG_NLS_CODEPAGE_855=m430430-CONFIG_NLS_CODEPAGE_857=m431431-CONFIG_NLS_CODEPAGE_860=m432432-CONFIG_NLS_CODEPAGE_861=m433433-CONFIG_NLS_CODEPAGE_862=m434434-CONFIG_NLS_CODEPAGE_863=m435435-CONFIG_NLS_CODEPAGE_864=m436436-CONFIG_NLS_CODEPAGE_865=m437437-CONFIG_NLS_CODEPAGE_866=m438438-CONFIG_NLS_CODEPAGE_869=m439439-CONFIG_NLS_CODEPAGE_936=m440440-CONFIG_NLS_CODEPAGE_950=m441441-CONFIG_NLS_CODEPAGE_932=m442442-CONFIG_NLS_CODEPAGE_949=m443443-CONFIG_NLS_CODEPAGE_874=m444444-CONFIG_NLS_ISO8859_8=m445445-CONFIG_NLS_CODEPAGE_1250=m446446-CONFIG_NLS_CODEPAGE_1251=m447447-CONFIG_NLS_ASCII=m448448-CONFIG_NLS_ISO8859_1=m449449-CONFIG_NLS_ISO8859_2=m450450-CONFIG_NLS_ISO8859_3=m451451-CONFIG_NLS_ISO8859_4=m452452-CONFIG_NLS_ISO8859_5=m453453-CONFIG_NLS_ISO8859_6=m454454-CONFIG_NLS_ISO8859_7=m455455-CONFIG_NLS_ISO8859_9=m456456-CONFIG_NLS_ISO8859_13=m457457-CONFIG_NLS_ISO8859_14=m458458-CONFIG_NLS_ISO8859_15=m459459-CONFIG_NLS_KOI8_R=m460460-CONFIG_NLS_KOI8_U=m461461-CONFIG_SECURITY=y462462-CONFIG_LSM_MMAP_MIN_ADDR=0463463-CONFIG_SECURITY_SELINUX=y464464-CONFIG_SECURITY_SELINUX_BOOTPARAM=y465465-CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0466466-CONFIG_SECURITY_SELINUX_DISABLE=y467467-CONFIG_SECURITY_SMACK=y468468-CONFIG_SECURITY_TOMOYO=y469469-CONFIG_CRYPTO_CRYPTD=m470470-CONFIG_CRYPTO_TEST=m471471-CONFIG_CRYPTO_GCM=m472472-CONFIG_CRYPTO_CTS=m473473-CONFIG_CRYPTO_LRW=m474474-CONFIG_CRYPTO_PCBC=m475475-CONFIG_CRYPTO_XTS=m476476-CONFIG_CRYPTO_HMAC=y477477-CONFIG_CRYPTO_XCBC=m478478-CONFIG_CRYPTO_VMAC=m479479-CONFIG_CRYPTO_MICHAEL_MIC=m480480-CONFIG_CRYPTO_RMD128=m481481-CONFIG_CRYPTO_RMD160=m482482-CONFIG_CRYPTO_RMD256=m483483-CONFIG_CRYPTO_RMD320=m484484-CONFIG_CRYPTO_TGR192=m485485-CONFIG_CRYPTO_WP512=m486486-CONFIG_CRYPTO_ANUBIS=m487487-CONFIG_CRYPTO_BLOWFISH=m488488-CONFIG_CRYPTO_CAMELLIA=m489489-CONFIG_CRYPTO_CAST5=m490490-CONFIG_CRYPTO_CAST6=m491491-CONFIG_CRYPTO_FCRYPT=m492492-CONFIG_CRYPTO_KHAZAD=m493493-CONFIG_CRYPTO_SALSA20=m494494-CONFIG_CRYPTO_SEED=m495495-CONFIG_CRYPTO_SERPENT=m496496-CONFIG_CRYPTO_TEA=m497497-CONFIG_CRYPTO_TWOFISH=m498498-CONFIG_CRYPTO_LZO=m499499-CONFIG_CRC7=m500500-CONFIG_PRINTK_TIME=y501501-CONFIG_DEBUG_INFO=y502502-# CONFIG_ENABLE_MUST_CHECK is not set503503-CONFIG_DEBUG_MEMORY_INIT=y504504-CONFIG_DETECT_HUNG_TASK=y505505-CONFIG_SCHEDSTATS=y506506-CONFIG_SCHED_TRACER=y507507-CONFIG_BLK_DEV_IO_TRACE=y508508-CONFIG_KGDB=y
···195195#ifdef CONFIG_SYS_HAS_CPU_BMIPS5000196196 case CPU_BMIPS5000:197197#endif198198-199199-#ifdef CONFIG_SYS_HAS_CPU_XLP200200- case CPU_XLP:201201-#endif202202-203203-#ifdef CONFIG_SYS_HAS_CPU_XLR204204- case CPU_XLR:205205-#endif206198 break;207199 default:208200 unreachable();
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2011 Netlogic Microsystems77- * Copyright (C) 2003 Ralf Baechle88- */99-#ifndef __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H1010-#define __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H1111-1212-#define cpu_has_4kex 11313-#define cpu_has_4k_cache 11414-#define cpu_has_watch 11515-#define cpu_has_mips16 01616-#define cpu_has_mips16e2 01717-#define cpu_has_counter 11818-#define cpu_has_divec 11919-#define cpu_has_vce 02020-#define cpu_has_cache_cdex_p 02121-#define cpu_has_cache_cdex_s 02222-#define cpu_has_prefetch 12323-#define cpu_has_mcheck 12424-#define cpu_has_ejtag 12525-2626-#define cpu_has_llsc 12727-#define cpu_has_vtag_icache 02828-#define cpu_has_ic_fills_f_dc 12929-#define cpu_has_dsp 03030-#define cpu_has_dsp2 03131-#define cpu_has_mipsmt 03232-#define cpu_icache_snoops_remote_store 13333-3434-#define cpu_has_64bits 13535-3636-#define cpu_has_mips32r1 13737-#define cpu_has_mips64r1 13838-3939-#define cpu_has_inclusive_pcaches 04040-4141-#define cpu_dcache_line_size() 324242-#define cpu_icache_line_size() 324343-4444-#if defined(CONFIG_CPU_XLR)4545-#define cpu_has_userlocal 04646-#define cpu_has_dc_aliases 04747-#define cpu_has_mips32r2 04848-#define cpu_has_mips64r2 04949-#elif defined(CONFIG_CPU_XLP)5050-#define cpu_has_userlocal 15151-#define cpu_has_mips32r2 15252-#define cpu_has_mips64r2 15353-#else5454-#error "Unknown Netlogic CPU"5555-#endif5656-5757-#endif /* __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H */
-17
arch/mips/include/asm/mach-netlogic/irq.h
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2011 Netlogic Microsystems.77- */88-#ifndef __ASM_NETLOGIC_IRQ_H99-#define __ASM_NETLOGIC_IRQ_H1010-1111-#include <asm/mach-netlogic/multi-node.h>1212-#define NLM_IRQS_PER_NODE 10241313-#define NR_IRQS (NLM_IRQS_PER_NODE * NLM_NR_NODES)1414-1515-#define MIPS_CPU_IRQ_BASE 01616-1717-#endif /* __ASM_NETLOGIC_IRQ_H */
-74
arch/mips/include/asm/mach-netlogic/multi-node.h
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _NETLOGIC_MULTI_NODE_H_3636-#define _NETLOGIC_MULTI_NODE_H_3737-3838-#ifndef CONFIG_NLM_MULTINODE3939-#define NLM_NR_NODES 14040-#else4141-#if defined(CONFIG_NLM_MULTINODE_2)4242-#define NLM_NR_NODES 24343-#elif defined(CONFIG_NLM_MULTINODE_4)4444-#define NLM_NR_NODES 44545-#else4646-#define NLM_NR_NODES 14747-#endif4848-#endif4949-5050-#define NLM_THREADS_PER_CORE 45151-5252-struct nlm_soc_info {5353- unsigned long coremask; /* cores enabled on the soc */5454- unsigned long ebase; /* not used now */5555- uint64_t irqmask; /* EIMR for the node */5656- uint64_t sysbase; /* only for XLP - sys block base */5757- uint64_t picbase; /* PIC block base */5858- spinlock_t piclock; /* lock for PIC access */5959- cpumask_t cpumask; /* logical cpu mask for node */6060- unsigned int socbus;6161-};6262-6363-extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES];6464-#define nlm_get_node(i) (&nlm_nodes[i])6565-#define nlm_node_present(n) ((n) >= 0 && (n) < NLM_NR_NODES && \6666- nlm_get_node(n)->coremask != 0)6767-#ifdef CONFIG_CPU_XLR6868-#define nlm_current_node() (&nlm_nodes[0])6969-#else7070-#define nlm_current_node() (&nlm_nodes[nlm_nodeid()])7171-#endif7272-void nlm_node_init(int node);7373-7474-#endif
-132
arch/mips/include/asm/netlogic/common.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _NETLOGIC_COMMON_H_3636-#define _NETLOGIC_COMMON_H_3737-3838-/*3939- * Common SMP definitions4040- */4141-#define RESET_VEC_PHYS 0x1fc000004242-#define RESET_VEC_SIZE 8192 /* 8KB reset code and data */4343-#define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10))4444-4545-/* Offsets of parameters in the RESET_DATA_PHYS area */4646-#define BOOT_THREAD_MODE 04747-#define BOOT_NMI_LOCK 44848-#define BOOT_NMI_HANDLER 84949-5050-/* CPU ready flags for each CPU */5151-#define BOOT_CPU_READY 20485252-5353-#ifndef __ASSEMBLY__5454-#include <linux/cpumask.h>5555-#include <linux/spinlock.h>5656-#include <asm/irq.h>5757-#include <asm/mach-netlogic/multi-node.h>5858-5959-struct irq_desc;6060-void nlm_smp_function_ipi_handler(struct irq_desc *desc);6161-void nlm_smp_resched_ipi_handler(struct irq_desc *desc);6262-void nlm_smp_irq_init(int hwcpuid);6363-void nlm_boot_secondary_cpus(void);6464-int nlm_wakeup_secondary_cpus(void);6565-void nlm_rmiboot_preboot(void);6666-void nlm_percpu_init(int hwcpuid);6767-6868-static inline void *6969-nlm_get_boot_data(int offset)7070-{7171- return (void *)(CKSEG1ADDR(RESET_DATA_PHYS) + offset);7272-}7373-7474-static inline void7575-nlm_set_nmi_handler(void *handler)7676-{7777- void *nmih = nlm_get_boot_data(BOOT_NMI_HANDLER);7878-7979- *(int64_t *)nmih = (long)handler;8080-}8181-8282-/*8383- * Misc.8484- */8585-void nlm_init_boot_cpu(void);8686-unsigned int nlm_get_cpu_frequency(void);8787-extern const struct plat_smp_ops nlm_smp_ops;8888-extern char nlm_reset_entry[], nlm_reset_entry_end[];8989-9090-extern unsigned int nlm_threads_per_core;9191-extern cpumask_t nlm_cpumask;9292-9393-struct irq_data;9494-uint64_t nlm_pci_irqmask(int node);9595-void nlm_setup_pic_irq(int node, int picirq, int irq, int irt);9696-void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *));9797-9898-#ifdef CONFIG_PCI_MSI9999-void nlm_dispatch_msi(int node, int lirq);100100-void nlm_dispatch_msix(int node, int msixirq);101101-#endif102102-103103-/*104104- * The NR_IRQs is divided between nodes, each of them has a separate irq space105105- */106106-static inline int nlm_irq_to_xirq(int node, int irq)107107-{108108- return node * NR_IRQS / NLM_NR_NODES + irq;109109-}110110-111111-#ifdef CONFIG_CPU_XLR112112-#define nlm_cores_per_node() 8113113-#else114114-static inline int nlm_cores_per_node(void)115115-{116116- return ((read_c0_prid() & PRID_IMP_MASK)117117- == PRID_IMP_NETLOGIC_XLP9XX) ? 32 : 8;118118-}119119-#endif120120-static inline int nlm_threads_per_node(void)121121-{122122- return nlm_cores_per_node() * NLM_THREADS_PER_CORE;123123-}124124-125125-static inline int nlm_hwtid_to_node(int hwtid)126126-{127127- return hwtid / nlm_threads_per_node();128128-}129129-130130-extern int nlm_cpu_ready[];131131-#endif /* __ASSEMBLY__ */132132-#endif /* _NETLOGIC_COMMON_H_ */
-171
arch/mips/include/asm/netlogic/haldefs.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_HALDEFS_H__3636-#define __NLM_HAL_HALDEFS_H__3737-3838-#include <linux/irqflags.h> /* for local_irq_disable */3939-4040-/*4141- * This file contains platform specific memory mapped IO implementation4242- * and will provide a way to read 32/64 bit memory mapped registers in4343- * all ABIs4444- */4545-static inline uint32_t4646-nlm_read_reg(uint64_t base, uint32_t reg)4747-{4848- volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg;4949-5050- return *addr;5151-}5252-5353-static inline void5454-nlm_write_reg(uint64_t base, uint32_t reg, uint32_t val)5555-{5656- volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg;5757-5858- *addr = val;5959-}6060-6161-/*6262- * For o32 compilation, we have to disable interrupts to access 64 bit6363- * registers6464- *6565- * We need to disable interrupts because we save just the lower 32 bits of6666- * registers in interrupt handling. So if we get hit by an interrupt while6767- * using the upper 32 bits of a register, we lose.6868- */6969-7070-static inline uint64_t7171-nlm_read_reg64(uint64_t base, uint32_t reg)7272-{7373- uint64_t addr = base + (reg >> 1) * sizeof(uint64_t);7474- volatile uint64_t *ptr = (volatile uint64_t *)(long)addr;7575- uint64_t val;7676-7777- if (sizeof(unsigned long) == 4) {7878- unsigned long flags;7979-8080- local_irq_save(flags);8181- __asm__ __volatile__(8282- ".set push" "\n\t"8383- ".set mips64" "\n\t"8484- "ld %L0, %1" "\n\t"8585- "dsra32 %M0, %L0, 0" "\n\t"8686- "sll %L0, %L0, 0" "\n\t"8787- ".set pop" "\n"8888- : "=r" (val)8989- : "m" (*ptr));9090- local_irq_restore(flags);9191- } else9292- val = *ptr;9393-9494- return val;9595-}9696-9797-static inline void9898-nlm_write_reg64(uint64_t base, uint32_t reg, uint64_t val)9999-{100100- uint64_t addr = base + (reg >> 1) * sizeof(uint64_t);101101- volatile uint64_t *ptr = (volatile uint64_t *)(long)addr;102102-103103- if (sizeof(unsigned long) == 4) {104104- unsigned long flags;105105- uint64_t tmp;106106-107107- local_irq_save(flags);108108- __asm__ __volatile__(109109- ".set push" "\n\t"110110- ".set mips64" "\n\t"111111- "dsll32 %L0, %L0, 0" "\n\t"112112- "dsrl32 %L0, %L0, 0" "\n\t"113113- "dsll32 %M0, %M0, 0" "\n\t"114114- "or %L0, %L0, %M0" "\n\t"115115- "sd %L0, %2" "\n\t"116116- ".set pop" "\n"117117- : "=r" (tmp)118118- : "0" (val), "m" (*ptr));119119- local_irq_restore(flags);120120- } else121121- *ptr = val;122122-}123123-124124-/*125125- * Routines to store 32/64 bit values to 64 bit addresses,126126- * used when going thru XKPHYS to access registers127127- */128128-static inline uint32_t129129-nlm_read_reg_xkphys(uint64_t base, uint32_t reg)130130-{131131- return nlm_read_reg(base, reg);132132-}133133-134134-static inline void135135-nlm_write_reg_xkphys(uint64_t base, uint32_t reg, uint32_t val)136136-{137137- nlm_write_reg(base, reg, val);138138-}139139-140140-static inline uint64_t141141-nlm_read_reg64_xkphys(uint64_t base, uint32_t reg)142142-{143143- return nlm_read_reg64(base, reg);144144-}145145-146146-static inline void147147-nlm_write_reg64_xkphys(uint64_t base, uint32_t reg, uint64_t val)148148-{149149- nlm_write_reg64(base, reg, val);150150-}151151-152152-/* Location where IO base is mapped */153153-extern uint64_t nlm_io_base;154154-155155-#if defined(CONFIG_CPU_XLP)156156-static inline uint64_t157157-nlm_pcicfg_base(uint32_t devoffset)158158-{159159- return nlm_io_base + devoffset;160160-}161161-162162-#elif defined(CONFIG_CPU_XLR)163163-164164-static inline uint64_t165165-nlm_mmio_base(uint32_t devoffset)166166-{167167- return nlm_io_base + devoffset;168168-}169169-#endif170170-171171-#endif
-45
arch/mips/include/asm/netlogic/interrupt.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_INTERRUPT_H3636-#define _ASM_NLM_INTERRUPT_H3737-3838-/* Defines for the IRQ numbers */3939-4040-#define IRQ_IPI_SMP_FUNCTION 34141-#define IRQ_IPI_SMP_RESCHEDULE 44242-#define IRQ_FMN 54343-#define IRQ_TIMER 74444-4545-#endif
-301
arch/mips/include/asm/netlogic/mips-extns.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_MIPS_EXTS_H3636-#define _ASM_NLM_MIPS_EXTS_H3737-3838-/*3939- * XLR and XLP interrupt request and interrupt mask registers4040- */4141-/*4242- * NOTE: Do not save/restore flags around write_c0_eimr().4343- * On non-R2 platforms the flags has part of EIMR that is shadowed in STATUS4444- * register. Restoring flags will overwrite the lower 8 bits of EIMR.4545- *4646- * Call with interrupts disabled.4747- */4848-#define write_c0_eimr(val) \4949-do { \5050- if (sizeof(unsigned long) == 4) { \5151- __asm__ __volatile__( \5252- ".set\tmips64\n\t" \5353- "dsll\t%L0, %L0, 32\n\t" \5454- "dsrl\t%L0, %L0, 32\n\t" \5555- "dsll\t%M0, %M0, 32\n\t" \5656- "or\t%L0, %L0, %M0\n\t" \5757- "dmtc0\t%L0, $9, 7\n\t" \5858- ".set\tmips0" \5959- : : "r" (val)); \6060- } else \6161- __write_64bit_c0_register($9, 7, (val)); \6262-} while (0)6363-6464-/*6565- * Handling the 64 bit EIMR and EIRR registers in 32-bit mode with6666- * standard functions will be very inefficient. This provides6767- * optimized functions for the normal operations on the registers.6868- *6969- * Call with interrupts disabled.7070- */7171-static inline void ack_c0_eirr(int irq)7272-{7373- __asm__ __volatile__(7474- ".set push\n\t"7575- ".set mips64\n\t"7676- ".set noat\n\t"7777- "li $1, 1\n\t"7878- "dsllv $1, $1, %0\n\t"7979- "dmtc0 $1, $9, 6\n\t"8080- ".set pop"8181- : : "r" (irq));8282-}8383-8484-static inline void set_c0_eimr(int irq)8585-{8686- __asm__ __volatile__(8787- ".set push\n\t"8888- ".set mips64\n\t"8989- ".set noat\n\t"9090- "li $1, 1\n\t"9191- "dsllv %0, $1, %0\n\t"9292- "dmfc0 $1, $9, 7\n\t"9393- "or $1, %0\n\t"9494- "dmtc0 $1, $9, 7\n\t"9595- ".set pop"9696- : "+r" (irq));9797-}9898-9999-static inline void clear_c0_eimr(int irq)100100-{101101- __asm__ __volatile__(102102- ".set push\n\t"103103- ".set mips64\n\t"104104- ".set noat\n\t"105105- "li $1, 1\n\t"106106- "dsllv %0, $1, %0\n\t"107107- "dmfc0 $1, $9, 7\n\t"108108- "or $1, %0\n\t"109109- "xor $1, %0\n\t"110110- "dmtc0 $1, $9, 7\n\t"111111- ".set pop"112112- : "+r" (irq));113113-}114114-115115-/*116116- * Read c0 eimr and c0 eirr, do AND of the two values, the result is117117- * the interrupts which are raised and are not masked.118118- */119119-static inline uint64_t read_c0_eirr_and_eimr(void)120120-{121121- uint64_t val;122122-123123-#ifdef CONFIG_64BIT124124- val = __read_64bit_c0_register($9, 6) & __read_64bit_c0_register($9, 7);125125-#else126126- __asm__ __volatile__(127127- ".set push\n\t"128128- ".set mips64\n\t"129129- ".set noat\n\t"130130- "dmfc0 %M0, $9, 6\n\t"131131- "dmfc0 %L0, $9, 7\n\t"132132- "and %M0, %L0\n\t"133133- "dsll %L0, %M0, 32\n\t"134134- "dsra %M0, %M0, 32\n\t"135135- "dsra %L0, %L0, 32\n\t"136136- ".set pop"137137- : "=r" (val));138138-#endif139139- return val;140140-}141141-142142-static inline int hard_smp_processor_id(void)143143-{144144- return __read_32bit_c0_register($15, 1) & 0x3ff;145145-}146146-147147-static inline int nlm_nodeid(void)148148-{149149- uint32_t prid = read_c0_prid() & PRID_IMP_MASK;150150-151151- if ((prid == PRID_IMP_NETLOGIC_XLP9XX) ||152152- (prid == PRID_IMP_NETLOGIC_XLP5XX))153153- return (__read_32bit_c0_register($15, 1) >> 7) & 0x7;154154- else155155- return (__read_32bit_c0_register($15, 1) >> 5) & 0x3;156156-}157157-158158-static inline unsigned int nlm_core_id(void)159159-{160160- uint32_t prid = read_c0_prid() & PRID_IMP_MASK;161161-162162- if ((prid == PRID_IMP_NETLOGIC_XLP9XX) ||163163- (prid == PRID_IMP_NETLOGIC_XLP5XX))164164- return (read_c0_ebase() & 0x7c) >> 2;165165- else166166- return (read_c0_ebase() & 0x1c) >> 2;167167-}168168-169169-static inline unsigned int nlm_thread_id(void)170170-{171171- return read_c0_ebase() & 0x3;172172-}173173-174174-#define __read_64bit_c2_split(source, sel) \175175-({ \176176- unsigned long long __val; \177177- unsigned long __flags; \178178- \179179- local_irq_save(__flags); \180180- if (sel == 0) \181181- __asm__ __volatile__( \182182- ".set\tmips64\n\t" \183183- "dmfc2\t%M0, " #source "\n\t" \184184- "dsll\t%L0, %M0, 32\n\t" \185185- "dsra\t%M0, %M0, 32\n\t" \186186- "dsra\t%L0, %L0, 32\n\t" \187187- ".set\tmips0\n\t" \188188- : "=r" (__val)); \189189- else \190190- __asm__ __volatile__( \191191- ".set\tmips64\n\t" \192192- "dmfc2\t%M0, " #source ", " #sel "\n\t" \193193- "dsll\t%L0, %M0, 32\n\t" \194194- "dsra\t%M0, %M0, 32\n\t" \195195- "dsra\t%L0, %L0, 32\n\t" \196196- ".set\tmips0\n\t" \197197- : "=r" (__val)); \198198- local_irq_restore(__flags); \199199- \200200- __val; \201201-})202202-203203-#define __write_64bit_c2_split(source, sel, val) \204204-do { \205205- unsigned long __flags; \206206- \207207- local_irq_save(__flags); \208208- if (sel == 0) \209209- __asm__ __volatile__( \210210- ".set\tmips64\n\t" \211211- "dsll\t%L0, %L0, 32\n\t" \212212- "dsrl\t%L0, %L0, 32\n\t" \213213- "dsll\t%M0, %M0, 32\n\t" \214214- "or\t%L0, %L0, %M0\n\t" \215215- "dmtc2\t%L0, " #source "\n\t" \216216- ".set\tmips0\n\t" \217217- : : "r" (val)); \218218- else \219219- __asm__ __volatile__( \220220- ".set\tmips64\n\t" \221221- "dsll\t%L0, %L0, 32\n\t" \222222- "dsrl\t%L0, %L0, 32\n\t" \223223- "dsll\t%M0, %M0, 32\n\t" \224224- "or\t%L0, %L0, %M0\n\t" \225225- "dmtc2\t%L0, " #source ", " #sel "\n\t" \226226- ".set\tmips0\n\t" \227227- : : "r" (val)); \228228- local_irq_restore(__flags); \229229-} while (0)230230-231231-#define __read_32bit_c2_register(source, sel) \232232-({ uint32_t __res; \233233- if (sel == 0) \234234- __asm__ __volatile__( \235235- ".set\tmips32\n\t" \236236- "mfc2\t%0, " #source "\n\t" \237237- ".set\tmips0\n\t" \238238- : "=r" (__res)); \239239- else \240240- __asm__ __volatile__( \241241- ".set\tmips32\n\t" \242242- "mfc2\t%0, " #source ", " #sel "\n\t" \243243- ".set\tmips0\n\t" \244244- : "=r" (__res)); \245245- __res; \246246-})247247-248248-#define __read_64bit_c2_register(source, sel) \249249-({ unsigned long long __res; \250250- if (sizeof(unsigned long) == 4) \251251- __res = __read_64bit_c2_split(source, sel); \252252- else if (sel == 0) \253253- __asm__ __volatile__( \254254- ".set\tmips64\n\t" \255255- "dmfc2\t%0, " #source "\n\t" \256256- ".set\tmips0\n\t" \257257- : "=r" (__res)); \258258- else \259259- __asm__ __volatile__( \260260- ".set\tmips64\n\t" \261261- "dmfc2\t%0, " #source ", " #sel "\n\t" \262262- ".set\tmips0\n\t" \263263- : "=r" (__res)); \264264- __res; \265265-})266266-267267-#define __write_64bit_c2_register(register, sel, value) \268268-do { \269269- if (sizeof(unsigned long) == 4) \270270- __write_64bit_c2_split(register, sel, value); \271271- else if (sel == 0) \272272- __asm__ __volatile__( \273273- ".set\tmips64\n\t" \274274- "dmtc2\t%z0, " #register "\n\t" \275275- ".set\tmips0\n\t" \276276- : : "Jr" (value)); \277277- else \278278- __asm__ __volatile__( \279279- ".set\tmips64\n\t" \280280- "dmtc2\t%z0, " #register ", " #sel "\n\t" \281281- ".set\tmips0\n\t" \282282- : : "Jr" (value)); \283283-} while (0)284284-285285-#define __write_32bit_c2_register(reg, sel, value) \286286-({ \287287- if (sel == 0) \288288- __asm__ __volatile__( \289289- ".set\tmips32\n\t" \290290- "mtc2\t%z0, " #reg "\n\t" \291291- ".set\tmips0\n\t" \292292- : : "Jr" (value)); \293293- else \294294- __asm__ __volatile__( \295295- ".set\tmips32\n\t" \296296- "mtc2\t%z0, " #reg ", " #sel "\n\t" \297297- ".set\tmips0\n\t" \298298- : : "Jr" (value)); \299299-})300300-301301-#endif /*_ASM_NLM_MIPS_EXTS_H */
-95
arch/mips/include/asm/netlogic/psb-bootinfo.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NETLOGIC_BOOTINFO_H3636-#define _ASM_NETLOGIC_BOOTINFO_H3737-3838-struct psb_info {3939- uint64_t boot_level;4040- uint64_t io_base;4141- uint64_t output_device;4242- uint64_t uart_print;4343- uint64_t led_output;4444- uint64_t init;4545- uint64_t exit;4646- uint64_t warm_reset;4747- uint64_t wakeup;4848- uint64_t online_cpu_map;4949- uint64_t master_reentry_sp;5050- uint64_t master_reentry_gp;5151- uint64_t master_reentry_fn;5252- uint64_t slave_reentry_fn;5353- uint64_t magic_dword;5454- uint64_t uart_putchar;5555- uint64_t size;5656- uint64_t uart_getchar;5757- uint64_t nmi_handler;5858- uint64_t psb_version;5959- uint64_t mac_addr;6060- uint64_t cpu_frequency;6161- uint64_t board_version;6262- uint64_t malloc;6363- uint64_t free;6464- uint64_t global_shmem_addr;6565- uint64_t global_shmem_size;6666- uint64_t psb_os_cpu_map;6767- uint64_t userapp_cpu_map;6868- uint64_t wakeup_os;6969- uint64_t psb_mem_map;7070- uint64_t board_major_version;7171- uint64_t board_minor_version;7272- uint64_t board_manf_revision;7373- uint64_t board_serial_number;7474- uint64_t psb_physaddr_map;7575- uint64_t xlr_loaderip_config;7676- uint64_t bldr_envp;7777- uint64_t avail_mem_map;7878-};7979-8080-/* This is what netlboot passes and linux boot_mem_map is subtly different */8181-#define NLM_BOOT_MEM_MAP_MAX 328282-struct nlm_boot_mem_map {8383- int nr_map;8484- struct nlm_boot_mem_map_entry {8585- uint64_t addr; /* start of memory segment */8686- uint64_t size; /* size of memory segment */8787- uint32_t type; /* type of memory segment */8888- } map[NLM_BOOT_MEM_MAP_MAX];8989-};9090-#define NLM_BOOT_MEM_RAM 19191-9292-/* Pointer to saved boot loader info */9393-extern struct psb_info nlm_prom_info;9494-9595-#endif
-186
arch/mips/include/asm/netlogic/xlp-hal/bridge.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_BRIDGE_H__3636-#define __NLM_HAL_BRIDGE_H__3737-3838-/**3939-* @file_name mio.h4040-* @author Netlogic Microsystems4141-* @brief Basic definitions of XLP memory and io subsystem4242-*/4343-4444-/*4545- * BRIDGE specific registers4646- *4747- * These registers start after the PCIe header, which has 0x404848- * standard entries4949- */5050-#define BRIDGE_MODE 0x005151-#define BRIDGE_PCI_CFG_BASE 0x015252-#define BRIDGE_PCI_CFG_LIMIT 0x025353-#define BRIDGE_PCIE_CFG_BASE 0x035454-#define BRIDGE_PCIE_CFG_LIMIT 0x045555-#define BRIDGE_BUSNUM_BAR0 0x055656-#define BRIDGE_BUSNUM_BAR1 0x065757-#define BRIDGE_BUSNUM_BAR2 0x075858-#define BRIDGE_BUSNUM_BAR3 0x085959-#define BRIDGE_BUSNUM_BAR4 0x096060-#define BRIDGE_BUSNUM_BAR5 0x0a6161-#define BRIDGE_BUSNUM_BAR6 0x0b6262-#define BRIDGE_FLASH_BAR0 0x0c6363-#define BRIDGE_FLASH_BAR1 0x0d6464-#define BRIDGE_FLASH_BAR2 0x0e6565-#define BRIDGE_FLASH_BAR3 0x0f6666-#define BRIDGE_FLASH_LIMIT0 0x106767-#define BRIDGE_FLASH_LIMIT1 0x116868-#define BRIDGE_FLASH_LIMIT2 0x126969-#define BRIDGE_FLASH_LIMIT3 0x137070-7171-#define BRIDGE_DRAM_BAR(i) (0x14 + (i))7272-#define BRIDGE_DRAM_LIMIT(i) (0x1c + (i))7373-#define BRIDGE_DRAM_NODE_TRANSLN(i) (0x24 + (i))7474-#define BRIDGE_DRAM_CHNL_TRANSLN(i) (0x2c + (i))7575-7676-#define BRIDGE_PCIEMEM_BASE0 0x347777-#define BRIDGE_PCIEMEM_BASE1 0x357878-#define BRIDGE_PCIEMEM_BASE2 0x367979-#define BRIDGE_PCIEMEM_BASE3 0x378080-#define BRIDGE_PCIEMEM_LIMIT0 0x388181-#define BRIDGE_PCIEMEM_LIMIT1 0x398282-#define BRIDGE_PCIEMEM_LIMIT2 0x3a8383-#define BRIDGE_PCIEMEM_LIMIT3 0x3b8484-#define BRIDGE_PCIEIO_BASE0 0x3c8585-#define BRIDGE_PCIEIO_BASE1 0x3d8686-#define BRIDGE_PCIEIO_BASE2 0x3e8787-#define BRIDGE_PCIEIO_BASE3 0x3f8888-#define BRIDGE_PCIEIO_LIMIT0 0x408989-#define BRIDGE_PCIEIO_LIMIT1 0x419090-#define BRIDGE_PCIEIO_LIMIT2 0x429191-#define BRIDGE_PCIEIO_LIMIT3 0x439292-#define BRIDGE_PCIEMEM_BASE4 0x449393-#define BRIDGE_PCIEMEM_BASE5 0x459494-#define BRIDGE_PCIEMEM_BASE6 0x469595-#define BRIDGE_PCIEMEM_LIMIT4 0x479696-#define BRIDGE_PCIEMEM_LIMIT5 0x489797-#define BRIDGE_PCIEMEM_LIMIT6 0x499898-#define BRIDGE_PCIEIO_BASE4 0x4a9999-#define BRIDGE_PCIEIO_BASE5 0x4b100100-#define BRIDGE_PCIEIO_BASE6 0x4c101101-#define BRIDGE_PCIEIO_LIMIT4 0x4d102102-#define BRIDGE_PCIEIO_LIMIT5 0x4e103103-#define BRIDGE_PCIEIO_LIMIT6 0x4f104104-#define BRIDGE_NBU_EVENT_CNT_CTL 0x50105105-#define BRIDGE_EVNTCTR1_LOW 0x51106106-#define BRIDGE_EVNTCTR1_HI 0x52107107-#define BRIDGE_EVNT_CNT_CTL2 0x53108108-#define BRIDGE_EVNTCTR2_LOW 0x54109109-#define BRIDGE_EVNTCTR2_HI 0x55110110-#define BRIDGE_TRACEBUF_MATCH0 0x56111111-#define BRIDGE_TRACEBUF_MATCH1 0x57112112-#define BRIDGE_TRACEBUF_MATCH_LOW 0x58113113-#define BRIDGE_TRACEBUF_MATCH_HI 0x59114114-#define BRIDGE_TRACEBUF_CTRL 0x5a115115-#define BRIDGE_TRACEBUF_INIT 0x5b116116-#define BRIDGE_TRACEBUF_ACCESS 0x5c117117-#define BRIDGE_TRACEBUF_READ_DATA0 0x5d118118-#define BRIDGE_TRACEBUF_READ_DATA1 0x5d119119-#define BRIDGE_TRACEBUF_READ_DATA2 0x5f120120-#define BRIDGE_TRACEBUF_READ_DATA3 0x60121121-#define BRIDGE_TRACEBUF_STATUS 0x61122122-#define BRIDGE_ADDRESS_ERROR0 0x62123123-#define BRIDGE_ADDRESS_ERROR1 0x63124124-#define BRIDGE_ADDRESS_ERROR2 0x64125125-#define BRIDGE_TAG_ECC_ADDR_ERROR0 0x65126126-#define BRIDGE_TAG_ECC_ADDR_ERROR1 0x66127127-#define BRIDGE_TAG_ECC_ADDR_ERROR2 0x67128128-#define BRIDGE_LINE_FLUSH0 0x68129129-#define BRIDGE_LINE_FLUSH1 0x69130130-#define BRIDGE_NODE_ID 0x6a131131-#define BRIDGE_ERROR_INTERRUPT_EN 0x6b132132-#define BRIDGE_PCIE0_WEIGHT 0x2c0133133-#define BRIDGE_PCIE1_WEIGHT 0x2c1134134-#define BRIDGE_PCIE2_WEIGHT 0x2c2135135-#define BRIDGE_PCIE3_WEIGHT 0x2c3136136-#define BRIDGE_USB_WEIGHT 0x2c4137137-#define BRIDGE_NET_WEIGHT 0x2c5138138-#define BRIDGE_POE_WEIGHT 0x2c6139139-#define BRIDGE_CMS_WEIGHT 0x2c7140140-#define BRIDGE_DMAENG_WEIGHT 0x2c8141141-#define BRIDGE_SEC_WEIGHT 0x2c9142142-#define BRIDGE_COMP_WEIGHT 0x2ca143143-#define BRIDGE_GIO_WEIGHT 0x2cb144144-#define BRIDGE_FLASH_WEIGHT 0x2cc145145-146146-/* FIXME verify */147147-#define BRIDGE_9XX_FLASH_BAR(i) (0x11 + (i))148148-#define BRIDGE_9XX_FLASH_BAR_LIMIT(i) (0x15 + (i))149149-150150-#define BRIDGE_9XX_DRAM_BAR(i) (0x19 + (i))151151-#define BRIDGE_9XX_DRAM_LIMIT(i) (0x29 + (i))152152-#define BRIDGE_9XX_DRAM_NODE_TRANSLN(i) (0x39 + (i))153153-#define BRIDGE_9XX_DRAM_CHNL_TRANSLN(i) (0x49 + (i))154154-155155-#define BRIDGE_9XX_ADDRESS_ERROR0 0x9d156156-#define BRIDGE_9XX_ADDRESS_ERROR1 0x9e157157-#define BRIDGE_9XX_ADDRESS_ERROR2 0x9f158158-159159-#define BRIDGE_9XX_PCIEMEM_BASE0 0x59160160-#define BRIDGE_9XX_PCIEMEM_BASE1 0x5a161161-#define BRIDGE_9XX_PCIEMEM_BASE2 0x5b162162-#define BRIDGE_9XX_PCIEMEM_BASE3 0x5c163163-#define BRIDGE_9XX_PCIEMEM_LIMIT0 0x5d164164-#define BRIDGE_9XX_PCIEMEM_LIMIT1 0x5e165165-#define BRIDGE_9XX_PCIEMEM_LIMIT2 0x5f166166-#define BRIDGE_9XX_PCIEMEM_LIMIT3 0x60167167-#define BRIDGE_9XX_PCIEIO_BASE0 0x61168168-#define BRIDGE_9XX_PCIEIO_BASE1 0x62169169-#define BRIDGE_9XX_PCIEIO_BASE2 0x63170170-#define BRIDGE_9XX_PCIEIO_BASE3 0x64171171-#define BRIDGE_9XX_PCIEIO_LIMIT0 0x65172172-#define BRIDGE_9XX_PCIEIO_LIMIT1 0x66173173-#define BRIDGE_9XX_PCIEIO_LIMIT2 0x67174174-#define BRIDGE_9XX_PCIEIO_LIMIT3 0x68175175-176176-#ifndef __ASSEMBLY__177177-178178-#define nlm_read_bridge_reg(b, r) nlm_read_reg(b, r)179179-#define nlm_write_bridge_reg(b, r, v) nlm_write_reg(b, r, v)180180-#define nlm_get_bridge_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \181181- XLP9XX_IO_BRIDGE_OFFSET(node) : XLP_IO_BRIDGE_OFFSET(node))182182-#define nlm_get_bridge_regbase(node) \183183- (nlm_get_bridge_pcibase(node) + XLP_IO_PCI_HDRSZ)184184-185185-#endif /* __ASSEMBLY__ */186186-#endif /* __NLM_HAL_BRIDGE_H__ */
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_CPUCONTROL_H__3636-#define __NLM_HAL_CPUCONTROL_H__3737-3838-#define CPU_BLOCKID_IFU 03939-#define CPU_BLOCKID_ICU 14040-#define CPU_BLOCKID_IEU 24141-#define CPU_BLOCKID_LSU 34242-#define CPU_BLOCKID_MMU 44343-#define CPU_BLOCKID_PRF 54444-#define CPU_BLOCKID_SCH 74545-#define CPU_BLOCKID_SCU 84646-#define CPU_BLOCKID_FPU 94747-#define CPU_BLOCKID_MAP 104848-4949-#define IFU_BRUB_RESERVE 0x0075050-5151-#define ICU_DEFEATURE 0x1005252-5353-#define LSU_DEFEATURE 0x3045454-#define LSU_DEBUG_ADDR 0x3055555-#define LSU_DEBUG_DATA0 0x3065656-#define LSU_CERRLOG_REGID 0x3095757-#define SCHED_DEFEATURE 0x7005858-5959-/* Offsets of interest from the 'MAP' Block */6060-#define MAP_THREADMODE 0x006161-#define MAP_EXT_EBASE_ENABLE 0x046262-#define MAP_CCDI_CONFIG 0x086363-#define MAP_THRD0_CCDI_STATUS 0x0c6464-#define MAP_THRD1_CCDI_STATUS 0x106565-#define MAP_THRD2_CCDI_STATUS 0x146666-#define MAP_THRD3_CCDI_STATUS 0x186767-#define MAP_THRD0_DEBUG_MODE 0x1c6868-#define MAP_THRD1_DEBUG_MODE 0x206969-#define MAP_THRD2_DEBUG_MODE 0x247070-#define MAP_THRD3_DEBUG_MODE 0x287171-#define MAP_MISC_STATE 0x607272-#define MAP_DEBUG_READ_CTL 0x647373-#define MAP_DEBUG_READ_REG0 0x687474-#define MAP_DEBUG_READ_REG1 0x6c7575-7676-#define MMU_SETUP 0x4007777-#define MMU_LFSRSEED 0x4017878-#define MMU_HPW_NUM_PAGE_LVL 0x4107979-#define MMU_PGWKR_PGDBASE 0x4118080-#define MMU_PGWKR_PGDSHFT 0x4128181-#define MMU_PGWKR_PGDMASK 0x4138282-#define MMU_PGWKR_PUDSHFT 0x4148383-#define MMU_PGWKR_PUDMASK 0x4158484-#define MMU_PGWKR_PMDSHFT 0x4168585-#define MMU_PGWKR_PMDMASK 0x4178686-#define MMU_PGWKR_PTESHFT 0x4188787-#define MMU_PGWKR_PTEMASK 0x4198888-8989-#endif /* __NLM_CPUCONTROL_H__ */
-214
arch/mips/include/asm/netlogic/xlp-hal/iomap.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_IOMAP_H__3636-#define __NLM_HAL_IOMAP_H__3737-3838-#define XLP_DEFAULT_IO_BASE 0x180000003939-#define XLP_DEFAULT_PCI_ECFG_BASE XLP_DEFAULT_IO_BASE4040-#define XLP_DEFAULT_PCI_CFG_BASE 0x1c0000004141-4242-#define NMI_BASE 0xbfc000004343-#define XLP_IO_CLK 1333333334444-4545-#define XLP_PCIE_CFG_SIZE 0x1000 /* 4K */4646-#define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE)4747-#define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE)4848-#define XLP_IO_SIZE (64 << 20) /* ECFG space size */4949-#define XLP_IO_PCI_HDRSZ 0x1005050-#define XLP_IO_DEV(node, dev) ((dev) + (node) * 8)5151-#define XLP_IO_PCI_OFFSET(b, d, f) (((b) << 20) | ((d) << 15) | ((f) << 12))5252-5353-#define XLP_HDR_OFFSET(node, bus, dev, fn) \5454- XLP_IO_PCI_OFFSET(bus, XLP_IO_DEV(node, dev), fn)5555-5656-#define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0)5757-/* coherent inter chip */5858-#define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1)5959-#define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2)6060-#define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3)6161-#define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4)6262-6363-#define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i)6464-#define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0)6565-#define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1)6666-#define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2)6767-#define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3)6868-6969-#define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i)7070-#define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0)7171-#define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1)7272-#define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2)7373-#define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3)7474-#define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4)7575-#define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5)7676-7777-#define XLP_IO_SATA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 2)7878-7979-/* XLP2xx has an updated USB block */8080-#define XLP2XX_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 4, i)8181-#define XLP2XX_IO_USB_XHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 1)8282-#define XLP2XX_IO_USB_XHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 2)8383-#define XLP2XX_IO_USB_XHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 3)8484-8585-#define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0)8686-#define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1)8787-8888-#define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0)8989-9090-#define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1)9191-#define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2)9292-#define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3)9393-9494-#define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i)9595-#define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0)9696-#define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1)9797-#define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + i)9898-#define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2)9999-#define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3)100100-#define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4)101101-/* on 2XX, all I2C busses are on the same block */102102-#define XLP2XX_IO_I2C_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 7)103103-104104-/* system management */105105-#define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5)106106-#define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6)107107-108108-/* Flash */109109-#define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0)110110-#define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1)111111-#define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2)112112-#define XLP_IO_MMC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3)113113-114114-/* Things have changed drastically in XLP 9XX */115115-#define XLP9XX_HDR_OFFSET(n, d, f) \116116- XLP_IO_PCI_OFFSET(xlp9xx_get_socbus(n), d, f)117117-118118-#define XLP9XX_IO_BRIDGE_OFFSET(node) XLP_IO_PCI_OFFSET(0, 0, node)119119-#define XLP9XX_IO_PIC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 0)120120-#define XLP9XX_IO_UART_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 2)121121-#define XLP9XX_IO_SYS_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 0)122122-#define XLP9XX_IO_FUSE_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 1)123123-#define XLP9XX_IO_CLOCK_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 2)124124-#define XLP9XX_IO_POWER_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 3)125125-#define XLP9XX_IO_JTAG_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 4)126126-127127-#define XLP9XX_IO_PCIE_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 1, i)128128-#define XLP9XX_IO_PCIE0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 0)129129-#define XLP9XX_IO_PCIE2_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 2)130130-#define XLP9XX_IO_PCIE3_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 3)131131-132132-/* XLP9xx USB block */133133-#define XLP9XX_IO_USB_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 4, i)134134-#define XLP9XX_IO_USB_XHCI0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 1)135135-#define XLP9XX_IO_USB_XHCI1_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 2)136136-137137-/* XLP9XX on-chip SATA controller */138138-#define XLP9XX_IO_SATA_OFFSET(node) XLP9XX_HDR_OFFSET(node, 3, 2)139139-140140-/* Flash */141141-#define XLP9XX_IO_NOR_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 0)142142-#define XLP9XX_IO_NAND_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 1)143143-#define XLP9XX_IO_SPI_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 2)144144-#define XLP9XX_IO_MMC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 3)145145-146146-/* PCI config header register id's */147147-#define XLP_PCI_CFGREG0 0x00148148-#define XLP_PCI_CFGREG1 0x01149149-#define XLP_PCI_CFGREG2 0x02150150-#define XLP_PCI_CFGREG3 0x03151151-#define XLP_PCI_CFGREG4 0x04152152-#define XLP_PCI_CFGREG5 0x05153153-#define XLP_PCI_DEVINFO_REG0 0x30154154-#define XLP_PCI_DEVINFO_REG1 0x31155155-#define XLP_PCI_DEVINFO_REG2 0x32156156-#define XLP_PCI_DEVINFO_REG3 0x33157157-#define XLP_PCI_DEVINFO_REG4 0x34158158-#define XLP_PCI_DEVINFO_REG5 0x35159159-#define XLP_PCI_DEVINFO_REG6 0x36160160-#define XLP_PCI_DEVINFO_REG7 0x37161161-#define XLP_PCI_DEVSCRATCH_REG0 0x38162162-#define XLP_PCI_DEVSCRATCH_REG1 0x39163163-#define XLP_PCI_DEVSCRATCH_REG2 0x3a164164-#define XLP_PCI_DEVSCRATCH_REG3 0x3b165165-#define XLP_PCI_MSGSTN_REG 0x3c166166-#define XLP_PCI_IRTINFO_REG 0x3d167167-#define XLP_PCI_UCODEINFO_REG 0x3e168168-#define XLP_PCI_SBB_WT_REG 0x3f169169-170170-/* PCI IDs for SoC device */171171-#define PCI_VENDOR_NETLOGIC 0x184e172172-173173-#define PCI_DEVICE_ID_NLM_ROOT 0x1001174174-#define PCI_DEVICE_ID_NLM_ICI 0x1002175175-#define PCI_DEVICE_ID_NLM_PIC 0x1003176176-#define PCI_DEVICE_ID_NLM_PCIE 0x1004177177-#define PCI_DEVICE_ID_NLM_EHCI 0x1007178178-#define PCI_DEVICE_ID_NLM_OHCI 0x1008179179-#define PCI_DEVICE_ID_NLM_NAE 0x1009180180-#define PCI_DEVICE_ID_NLM_POE 0x100A181181-#define PCI_DEVICE_ID_NLM_FMN 0x100B182182-#define PCI_DEVICE_ID_NLM_RAID 0x100D183183-#define PCI_DEVICE_ID_NLM_SAE 0x100D184184-#define PCI_DEVICE_ID_NLM_RSA 0x100E185185-#define PCI_DEVICE_ID_NLM_CMP 0x100F186186-#define PCI_DEVICE_ID_NLM_UART 0x1010187187-#define PCI_DEVICE_ID_NLM_I2C 0x1011188188-#define PCI_DEVICE_ID_NLM_NOR 0x1015189189-#define PCI_DEVICE_ID_NLM_NAND 0x1016190190-#define PCI_DEVICE_ID_NLM_MMC 0x1018191191-#define PCI_DEVICE_ID_NLM_SATA 0x101A192192-#define PCI_DEVICE_ID_NLM_XHCI 0x101D193193-194194-#define PCI_DEVICE_ID_XLP9XX_MMC 0x9018195195-#define PCI_DEVICE_ID_XLP9XX_SATA 0x901A196196-#define PCI_DEVICE_ID_XLP9XX_XHCI 0x901D197197-198198-#ifndef __ASSEMBLY__199199-200200-#define nlm_read_pci_reg(b, r) nlm_read_reg(b, r)201201-#define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v)202202-203203-static inline int xlp9xx_get_socbus(int node)204204-{205205- uint64_t socbridge;206206-207207- if (node == 0)208208- return 1;209209- socbridge = nlm_pcicfg_base(XLP9XX_IO_BRIDGE_OFFSET(node));210210- return (nlm_read_pci_reg(socbridge, 0x6) >> 8) & 0xff;211211-}212212-#endif /* !__ASSEMBLY */213213-214214-#endif /* __NLM_HAL_IOMAP_H__ */
-113
arch/mips/include/asm/netlogic/xlp-hal/pcibus.h
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_PCIBUS_H__3636-#define __NLM_HAL_PCIBUS_H__3737-3838-/* PCIE Memory and IO regions */3939-#define PCIE_MEM_BASE 0xd0000000ULL4040-#define PCIE_MEM_LIMIT 0xdfffffffULL4141-#define PCIE_IO_BASE 0x14000000ULL4242-#define PCIE_IO_LIMIT 0x15ffffffULL4343-4444-#define PCIE_BRIDGE_CMD 0x14545-#define PCIE_BRIDGE_MSI_CAP 0x144646-#define PCIE_BRIDGE_MSI_ADDRL 0x154747-#define PCIE_BRIDGE_MSI_ADDRH 0x164848-#define PCIE_BRIDGE_MSI_DATA 0x174949-5050-/* XLP Global PCIE configuration space registers */5151-#define PCIE_BYTE_SWAP_MEM_BASE 0x2475252-#define PCIE_BYTE_SWAP_MEM_LIM 0x2485353-#define PCIE_BYTE_SWAP_IO_BASE 0x2495454-#define PCIE_BYTE_SWAP_IO_LIM 0x24A5555-5656-#define PCIE_BRIDGE_MSIX_ADDR_BASE 0x24F5757-#define PCIE_BRIDGE_MSIX_ADDR_LIMIT 0x2505858-#define PCIE_MSI_STATUS 0x25A5959-#define PCIE_MSI_EN 0x25B6060-#define PCIE_MSIX_STATUS 0x25D6161-#define PCIE_INT_STATUS0 0x25F6262-#define PCIE_INT_STATUS1 0x2606363-#define PCIE_INT_EN0 0x2616464-#define PCIE_INT_EN1 0x2626565-6666-/* XLP9XX has basic changes */6767-#define PCIE_9XX_BYTE_SWAP_MEM_BASE 0x25c6868-#define PCIE_9XX_BYTE_SWAP_MEM_LIM 0x25d6969-#define PCIE_9XX_BYTE_SWAP_IO_BASE 0x25e7070-#define PCIE_9XX_BYTE_SWAP_IO_LIM 0x25f7171-7272-#define PCIE_9XX_BRIDGE_MSIX_ADDR_BASE 0x2647373-#define PCIE_9XX_BRIDGE_MSIX_ADDR_LIMIT 0x2657474-#define PCIE_9XX_MSI_STATUS 0x2837575-#define PCIE_9XX_MSI_EN 0x2847676-/* 128 MSIX vectors available in 9xx */7777-#define PCIE_9XX_MSIX_STATUS0 0x2867878-#define PCIE_9XX_MSIX_STATUSX(n) (n + 0x286)7979-#define PCIE_9XX_MSIX_VEC 0x2968080-#define PCIE_9XX_MSIX_VECX(n) (n + 0x296)8181-#define PCIE_9XX_INT_STATUS0 0x3978282-#define PCIE_9XX_INT_STATUS1 0x3988383-#define PCIE_9XX_INT_EN0 0x3998484-#define PCIE_9XX_INT_EN1 0x39a8585-8686-/* other */8787-#define PCIE_NLINKS 48888-8989-/* MSI addresses */9090-#define MSI_ADDR_BASE 0xfffee00000ULL9191-#define MSI_ADDR_SZ 0x100009292-#define MSI_LINK_ADDR(n, l) (MSI_ADDR_BASE + \9393- (PCIE_NLINKS * (n) + (l)) * MSI_ADDR_SZ)9494-#define MSIX_ADDR_BASE 0xfffef00000ULL9595-#define MSIX_LINK_ADDR(n, l) (MSIX_ADDR_BASE + \9696- (PCIE_NLINKS * (n) + (l)) * MSI_ADDR_SZ)9797-#ifndef __ASSEMBLY__9898-9999-#define nlm_read_pcie_reg(b, r) nlm_read_reg(b, r)100100-#define nlm_write_pcie_reg(b, r, v) nlm_write_reg(b, r, v)101101-#define nlm_get_pcie_base(node, inst) nlm_pcicfg_base(cpu_is_xlp9xx() ? \102102- XLP9XX_IO_PCIE_OFFSET(node, inst) : XLP_IO_PCIE_OFFSET(node, inst))103103-104104-#ifdef CONFIG_PCI_MSI105105-void xlp_init_node_msi_irqs(int node, int link);106106-#else107107-static inline void xlp_init_node_msi_irqs(int node, int link) {}108108-#endif109109-110110-struct pci_dev *xlp_get_pcie_link(const struct pci_dev *dev);111111-112112-#endif113113-#endif /* __NLM_HAL_PCIBUS_H__ */
-366
arch/mips/include/asm/netlogic/xlp-hal/pic.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _NLM_HAL_PIC_H3636-#define _NLM_HAL_PIC_H3737-3838-/* PIC Specific registers */3939-#define PIC_CTRL 0x004040-4141-/* PIC control register defines */4242-#define PIC_CTRL_ITV 32 /* interrupt timeout value */4343-#define PIC_CTRL_ICI 19 /* ICI interrupt timeout enable */4444-#define PIC_CTRL_ITE 18 /* interrupt timeout enable */4545-#define PIC_CTRL_STE 10 /* system timer interrupt enable */4646-#define PIC_CTRL_WWR1 8 /* watchdog 1 wraparound count for reset */4747-#define PIC_CTRL_WWR0 6 /* watchdog 0 wraparound count for reset */4848-#define PIC_CTRL_WWN1 4 /* watchdog 1 wraparound count for NMI */4949-#define PIC_CTRL_WWN0 2 /* watchdog 0 wraparound count for NMI */5050-#define PIC_CTRL_WTE 0 /* watchdog timer enable */5151-5252-/* PIC Status register defines */5353-#define PIC_ICI_STATUS 33 /* ICI interrupt timeout status */5454-#define PIC_ITE_STATUS 32 /* interrupt timeout status */5555-#define PIC_STS_STATUS 4 /* System timer interrupt status */5656-#define PIC_WNS_STATUS 2 /* NMI status for watchdog timers */5757-#define PIC_WIS_STATUS 0 /* Interrupt status for watchdog timers */5858-5959-/* PIC IPI control register offsets */6060-#define PIC_IPICTRL_NMI 326161-#define PIC_IPICTRL_RIV 20 /* received interrupt vector */6262-#define PIC_IPICTRL_IDB 16 /* interrupt destination base */6363-#define PIC_IPICTRL_DTE 0 /* interrupt destination thread enables */6464-6565-/* PIC IRT register offsets */6666-#define PIC_IRT_ENABLE 316767-#define PIC_IRT_NMI 296868-#define PIC_IRT_SCH 28 /* Scheduling scheme */6969-#define PIC_IRT_RVEC 20 /* Interrupt receive vectors */7070-#define PIC_IRT_DT 19 /* Destination type */7171-#define PIC_IRT_DB 16 /* Destination base */7272-#define PIC_IRT_DTE 0 /* Destination thread enables */7373-7474-#define PIC_BYTESWAP 0x027575-#define PIC_STATUS 0x047676-#define PIC_INTR_TIMEOUT 0x067777-#define PIC_ICI0_INTR_TIMEOUT 0x087878-#define PIC_ICI1_INTR_TIMEOUT 0x0a7979-#define PIC_ICI2_INTR_TIMEOUT 0x0c8080-#define PIC_IPI_CTL 0x0e8181-#define PIC_INT_ACK 0x108282-#define PIC_INT_PENDING0 0x128383-#define PIC_INT_PENDING1 0x148484-#define PIC_INT_PENDING2 0x168585-8686-#define PIC_WDOG0_MAXVAL 0x188787-#define PIC_WDOG0_COUNT 0x1a8888-#define PIC_WDOG0_ENABLE0 0x1c8989-#define PIC_WDOG0_ENABLE1 0x1e9090-#define PIC_WDOG0_BEATCMD 0x209191-#define PIC_WDOG0_BEAT0 0x229292-#define PIC_WDOG0_BEAT1 0x249393-9494-#define PIC_WDOG1_MAXVAL 0x269595-#define PIC_WDOG1_COUNT 0x289696-#define PIC_WDOG1_ENABLE0 0x2a9797-#define PIC_WDOG1_ENABLE1 0x2c9898-#define PIC_WDOG1_BEATCMD 0x2e9999-#define PIC_WDOG1_BEAT0 0x30100100-#define PIC_WDOG1_BEAT1 0x32101101-102102-#define PIC_WDOG_MAXVAL(i) (PIC_WDOG0_MAXVAL + ((i) ? 7 : 0))103103-#define PIC_WDOG_COUNT(i) (PIC_WDOG0_COUNT + ((i) ? 7 : 0))104104-#define PIC_WDOG_ENABLE0(i) (PIC_WDOG0_ENABLE0 + ((i) ? 7 : 0))105105-#define PIC_WDOG_ENABLE1(i) (PIC_WDOG0_ENABLE1 + ((i) ? 7 : 0))106106-#define PIC_WDOG_BEATCMD(i) (PIC_WDOG0_BEATCMD + ((i) ? 7 : 0))107107-#define PIC_WDOG_BEAT0(i) (PIC_WDOG0_BEAT0 + ((i) ? 7 : 0))108108-#define PIC_WDOG_BEAT1(i) (PIC_WDOG0_BEAT1 + ((i) ? 7 : 0))109109-110110-#define PIC_TIMER0_MAXVAL 0x34111111-#define PIC_TIMER1_MAXVAL 0x36112112-#define PIC_TIMER2_MAXVAL 0x38113113-#define PIC_TIMER3_MAXVAL 0x3a114114-#define PIC_TIMER4_MAXVAL 0x3c115115-#define PIC_TIMER5_MAXVAL 0x3e116116-#define PIC_TIMER6_MAXVAL 0x40117117-#define PIC_TIMER7_MAXVAL 0x42118118-#define PIC_TIMER_MAXVAL(i) (PIC_TIMER0_MAXVAL + ((i) * 2))119119-120120-#define PIC_TIMER0_COUNT 0x44121121-#define PIC_TIMER1_COUNT 0x46122122-#define PIC_TIMER2_COUNT 0x48123123-#define PIC_TIMER3_COUNT 0x4a124124-#define PIC_TIMER4_COUNT 0x4c125125-#define PIC_TIMER5_COUNT 0x4e126126-#define PIC_TIMER6_COUNT 0x50127127-#define PIC_TIMER7_COUNT 0x52128128-#define PIC_TIMER_COUNT(i) (PIC_TIMER0_COUNT + ((i) * 2))129129-130130-#define PIC_ITE0_N0_N1 0x54131131-#define PIC_ITE1_N0_N1 0x58132132-#define PIC_ITE2_N0_N1 0x5c133133-#define PIC_ITE3_N0_N1 0x60134134-#define PIC_ITE4_N0_N1 0x64135135-#define PIC_ITE5_N0_N1 0x68136136-#define PIC_ITE6_N0_N1 0x6c137137-#define PIC_ITE7_N0_N1 0x70138138-#define PIC_ITE_N0_N1(i) (PIC_ITE0_N0_N1 + ((i) * 4))139139-140140-#define PIC_ITE0_N2_N3 0x56141141-#define PIC_ITE1_N2_N3 0x5a142142-#define PIC_ITE2_N2_N3 0x5e143143-#define PIC_ITE3_N2_N3 0x62144144-#define PIC_ITE4_N2_N3 0x66145145-#define PIC_ITE5_N2_N3 0x6a146146-#define PIC_ITE6_N2_N3 0x6e147147-#define PIC_ITE7_N2_N3 0x72148148-#define PIC_ITE_N2_N3(i) (PIC_ITE0_N2_N3 + ((i) * 4))149149-150150-#define PIC_IRT0 0x74151151-#define PIC_IRT(i) (PIC_IRT0 + ((i) * 2))152152-153153-#define PIC_9XX_PENDING_0 0x6154154-#define PIC_9XX_PENDING_1 0x8155155-#define PIC_9XX_PENDING_2 0xa156156-#define PIC_9XX_PENDING_3 0xc157157-158158-#define PIC_9XX_IRT0 0x1c0159159-#define PIC_9XX_IRT(i) (PIC_9XX_IRT0 + ((i) * 2))160160-161161-/*162162- * IRT Map163163- */164164-#define PIC_NUM_IRTS 160165165-#define PIC_9XX_NUM_IRTS 256166166-167167-#define PIC_IRT_WD_0_INDEX 0168168-#define PIC_IRT_WD_1_INDEX 1169169-#define PIC_IRT_WD_NMI_0_INDEX 2170170-#define PIC_IRT_WD_NMI_1_INDEX 3171171-#define PIC_IRT_TIMER_0_INDEX 4172172-#define PIC_IRT_TIMER_1_INDEX 5173173-#define PIC_IRT_TIMER_2_INDEX 6174174-#define PIC_IRT_TIMER_3_INDEX 7175175-#define PIC_IRT_TIMER_4_INDEX 8176176-#define PIC_IRT_TIMER_5_INDEX 9177177-#define PIC_IRT_TIMER_6_INDEX 10178178-#define PIC_IRT_TIMER_7_INDEX 11179179-#define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX180180-#define PIC_IRT_TIMER_INDEX(num) ((num) + PIC_IRT_TIMER_0_INDEX)181181-182182-183183-/* 11 and 12 */184184-#define PIC_NUM_MSG_Q_IRTS 32185185-#define PIC_IRT_MSG_Q0_INDEX 12186186-#define PIC_IRT_MSG_Q_INDEX(qid) ((qid) + PIC_IRT_MSG_Q0_INDEX)187187-/* 12 to 43 */188188-#define PIC_IRT_MSG_0_INDEX 44189189-#define PIC_IRT_MSG_1_INDEX 45190190-/* 44 and 45 */191191-#define PIC_NUM_PCIE_MSIX_IRTS 32192192-#define PIC_IRT_PCIE_MSIX_0_INDEX 46193193-#define PIC_IRT_PCIE_MSIX_INDEX(num) ((num) + PIC_IRT_PCIE_MSIX_0_INDEX)194194-/* 46 to 77 */195195-#define PIC_NUM_PCIE_LINK_IRTS 4196196-#define PIC_IRT_PCIE_LINK_0_INDEX 78197197-#define PIC_IRT_PCIE_LINK_1_INDEX 79198198-#define PIC_IRT_PCIE_LINK_2_INDEX 80199199-#define PIC_IRT_PCIE_LINK_3_INDEX 81200200-#define PIC_IRT_PCIE_LINK_INDEX(num) ((num) + PIC_IRT_PCIE_LINK_0_INDEX)201201-202202-#define PIC_9XX_IRT_PCIE_LINK_0_INDEX 191203203-#define PIC_9XX_IRT_PCIE_LINK_INDEX(num) \204204- ((num) + PIC_9XX_IRT_PCIE_LINK_0_INDEX)205205-206206-#define PIC_CLOCK_TIMER 7207207-208208-#if !defined(LOCORE) && !defined(__ASSEMBLY__)209209-210210-/*211211- * Misc212212- */213213-#define PIC_IRT_VALID 1214214-#define PIC_LOCAL_SCHEDULING 1215215-#define PIC_GLOBAL_SCHEDULING 0216216-217217-#define nlm_read_pic_reg(b, r) nlm_read_reg64(b, r)218218-#define nlm_write_pic_reg(b, r, v) nlm_write_reg64(b, r, v)219219-#define nlm_get_pic_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \220220- XLP9XX_IO_PIC_OFFSET(node) : XLP_IO_PIC_OFFSET(node))221221-#define nlm_get_pic_regbase(node) (nlm_get_pic_pcibase(node) + XLP_IO_PCI_HDRSZ)222222-223223-/* We use PIC on node 0 as a timer */224224-#define pic_timer_freq() nlm_get_pic_frequency(0)225225-226226-/* IRT and h/w interrupt routines */227227-static inline void228228-nlm_9xx_pic_write_irt(uint64_t base, int irt_num, int en, int nmi,229229- int sch, int vec, int dt, int db, int cpu)230230-{231231- uint64_t val;232232-233233- val = (((uint64_t)en & 0x1) << 22) | ((nmi & 0x1) << 23) |234234- ((0 /*mc*/) << 20) | ((vec & 0x3f) << 24) |235235- ((dt & 0x1) << 21) | (0 /*ptr*/ << 16) |236236- (cpu & 0x3ff);237237-238238- nlm_write_pic_reg(base, PIC_9XX_IRT(irt_num), val);239239-}240240-241241-static inline void242242-nlm_pic_write_irt(uint64_t base, int irt_num, int en, int nmi,243243- int sch, int vec, int dt, int db, int dte)244244-{245245- uint64_t val;246246-247247- val = (((uint64_t)en & 0x1) << 31) | ((nmi & 0x1) << 29) |248248- ((sch & 0x1) << 28) | ((vec & 0x3f) << 20) |249249- ((dt & 0x1) << 19) | ((db & 0x7) << 16) |250250- (dte & 0xffff);251251-252252- nlm_write_pic_reg(base, PIC_IRT(irt_num), val);253253-}254254-255255-static inline void256256-nlm_pic_write_irt_direct(uint64_t base, int irt_num, int en, int nmi,257257- int sch, int vec, int cpu)258258-{259259- if (cpu_is_xlp9xx())260260- nlm_9xx_pic_write_irt(base, irt_num, en, nmi, sch, vec,261261- 1, 0, cpu);262262- else263263- nlm_pic_write_irt(base, irt_num, en, nmi, sch, vec, 1,264264- (cpu >> 4), /* thread group */265265- 1 << (cpu & 0xf)); /* thread mask */266266-}267267-268268-static inline uint64_t269269-nlm_pic_read_timer(uint64_t base, int timer)270270-{271271- return nlm_read_pic_reg(base, PIC_TIMER_COUNT(timer));272272-}273273-274274-static inline uint32_t275275-nlm_pic_read_timer32(uint64_t base, int timer)276276-{277277- return (uint32_t)nlm_read_pic_reg(base, PIC_TIMER_COUNT(timer));278278-}279279-280280-static inline void281281-nlm_pic_write_timer(uint64_t base, int timer, uint64_t value)282282-{283283- nlm_write_pic_reg(base, PIC_TIMER_COUNT(timer), value);284284-}285285-286286-static inline void287287-nlm_pic_set_timer(uint64_t base, int timer, uint64_t value, int irq, int cpu)288288-{289289- uint64_t pic_ctrl = nlm_read_pic_reg(base, PIC_CTRL);290290- int en;291291-292292- en = (irq > 0);293293- nlm_write_pic_reg(base, PIC_TIMER_MAXVAL(timer), value);294294- nlm_pic_write_irt_direct(base, PIC_IRT_TIMER_INDEX(timer),295295- en, 0, 0, irq, cpu);296296-297297- /* enable the timer */298298- pic_ctrl |= (1 << (PIC_CTRL_STE + timer));299299- nlm_write_pic_reg(base, PIC_CTRL, pic_ctrl);300300-}301301-302302-static inline void303303-nlm_pic_enable_irt(uint64_t base, int irt)304304-{305305- uint64_t reg;306306-307307- if (cpu_is_xlp9xx()) {308308- reg = nlm_read_pic_reg(base, PIC_9XX_IRT(irt));309309- nlm_write_pic_reg(base, PIC_9XX_IRT(irt), reg | (1 << 22));310310- } else {311311- reg = nlm_read_pic_reg(base, PIC_IRT(irt));312312- nlm_write_pic_reg(base, PIC_IRT(irt), reg | (1u << 31));313313- }314314-}315315-316316-static inline void317317-nlm_pic_disable_irt(uint64_t base, int irt)318318-{319319- uint64_t reg;320320-321321- if (cpu_is_xlp9xx()) {322322- reg = nlm_read_pic_reg(base, PIC_9XX_IRT(irt));323323- reg &= ~((uint64_t)1 << 22);324324- nlm_write_pic_reg(base, PIC_9XX_IRT(irt), reg);325325- } else {326326- reg = nlm_read_pic_reg(base, PIC_IRT(irt));327327- reg &= ~((uint64_t)1 << 31);328328- nlm_write_pic_reg(base, PIC_IRT(irt), reg);329329- }330330-}331331-332332-static inline void333333-nlm_pic_send_ipi(uint64_t base, int hwt, int irq, int nmi)334334-{335335- uint64_t ipi;336336-337337- if (cpu_is_xlp9xx())338338- ipi = (nmi << 23) | (irq << 24) |339339- (0/*mcm*/ << 20) | (0/*ptr*/ << 16) | hwt;340340- else341341- ipi = ((uint64_t)nmi << 31) | (irq << 20) |342342- ((hwt >> 4) << 16) | (1 << (hwt & 0xf));343343-344344- nlm_write_pic_reg(base, PIC_IPI_CTL, ipi);345345-}346346-347347-static inline void348348-nlm_pic_ack(uint64_t base, int irt_num)349349-{350350- nlm_write_pic_reg(base, PIC_INT_ACK, irt_num);351351-352352- /* Ack the Status register for Watchdog & System timers */353353- if (irt_num < 12)354354- nlm_write_pic_reg(base, PIC_STATUS, (1 << irt_num));355355-}356356-357357-static inline void358358-nlm_pic_init_irt(uint64_t base, int irt, int irq, int hwt, int en)359359-{360360- nlm_pic_write_irt_direct(base, irt, en, 0, 0, irq, hwt);361361-}362362-363363-int nlm_irq_to_irt(int irq);364364-365365-#endif /* __ASSEMBLY__ */366366-#endif /* _NLM_HAL_PIC_H */
-213
arch/mips/include/asm/netlogic/xlp-hal/sys.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __NLM_HAL_SYS_H__3636-#define __NLM_HAL_SYS_H__3737-3838-/**3939-* @file_name sys.h4040-* @author Netlogic Microsystems4141-* @brief HAL for System configuration registers4242-*/4343-#define SYS_CHIP_RESET 0x004444-#define SYS_POWER_ON_RESET_CFG 0x014545-#define SYS_EFUSE_DEVICE_CFG_STATUS0 0x024646-#define SYS_EFUSE_DEVICE_CFG_STATUS1 0x034747-#define SYS_EFUSE_DEVICE_CFG_STATUS2 0x044848-#define SYS_EFUSE_DEVICE_CFG3 0x054949-#define SYS_EFUSE_DEVICE_CFG4 0x065050-#define SYS_EFUSE_DEVICE_CFG5 0x075151-#define SYS_EFUSE_DEVICE_CFG6 0x085252-#define SYS_EFUSE_DEVICE_CFG7 0x095353-#define SYS_PLL_CTRL 0x0a5454-#define SYS_CPU_RESET 0x0b5555-#define SYS_CPU_NONCOHERENT_MODE 0x0d5656-#define SYS_CORE_DFS_DIS_CTRL 0x0e5757-#define SYS_CORE_DFS_RST_CTRL 0x0f5858-#define SYS_CORE_DFS_BYP_CTRL 0x105959-#define SYS_CORE_DFS_PHA_CTRL 0x116060-#define SYS_CORE_DFS_DIV_INC_CTRL 0x126161-#define SYS_CORE_DFS_DIV_DEC_CTRL 0x136262-#define SYS_CORE_DFS_DIV_VALUE 0x146363-#define SYS_RESET 0x156464-#define SYS_DFS_DIS_CTRL 0x166565-#define SYS_DFS_RST_CTRL 0x176666-#define SYS_DFS_BYP_CTRL 0x186767-#define SYS_DFS_DIV_INC_CTRL 0x196868-#define SYS_DFS_DIV_DEC_CTRL 0x1a6969-#define SYS_DFS_DIV_VALUE0 0x1b7070-#define SYS_DFS_DIV_VALUE1 0x1c7171-#define SYS_SENSE_AMP_DLY 0x1d7272-#define SYS_SOC_SENSE_AMP_DLY 0x1e7373-#define SYS_CTRL0 0x1f7474-#define SYS_CTRL1 0x207575-#define SYS_TIMEOUT_BS1 0x217676-#define SYS_BYTE_SWAP 0x227777-#define SYS_VRM_VID 0x237878-#define SYS_PWR_RAM_CMD 0x247979-#define SYS_PWR_RAM_ADDR 0x258080-#define SYS_PWR_RAM_DATA0 0x268181-#define SYS_PWR_RAM_DATA1 0x278282-#define SYS_PWR_RAM_DATA2 0x288383-#define SYS_PWR_UCODE 0x298484-#define SYS_CPU0_PWR_STATUS 0x2a8585-#define SYS_CPU1_PWR_STATUS 0x2b8686-#define SYS_CPU2_PWR_STATUS 0x2c8787-#define SYS_CPU3_PWR_STATUS 0x2d8888-#define SYS_CPU4_PWR_STATUS 0x2e8989-#define SYS_CPU5_PWR_STATUS 0x2f9090-#define SYS_CPU6_PWR_STATUS 0x309191-#define SYS_CPU7_PWR_STATUS 0x319292-#define SYS_STATUS 0x329393-#define SYS_INT_POL 0x339494-#define SYS_INT_TYPE 0x349595-#define SYS_INT_STATUS 0x359696-#define SYS_INT_MASK0 0x369797-#define SYS_INT_MASK1 0x379898-#define SYS_UCO_S_ECC 0x389999-#define SYS_UCO_M_ECC 0x39100100-#define SYS_UCO_ADDR 0x3a101101-#define SYS_UCO_INSTR 0x3b102102-#define SYS_MEM_BIST0 0x3c103103-#define SYS_MEM_BIST1 0x3d104104-#define SYS_MEM_BIST2 0x3e105105-#define SYS_MEM_BIST3 0x3f106106-#define SYS_MEM_BIST4 0x40107107-#define SYS_MEM_BIST5 0x41108108-#define SYS_MEM_BIST6 0x42109109-#define SYS_MEM_BIST7 0x43110110-#define SYS_MEM_BIST8 0x44111111-#define SYS_MEM_BIST9 0x45112112-#define SYS_MEM_BIST10 0x46113113-#define SYS_MEM_BIST11 0x47114114-#define SYS_MEM_BIST12 0x48115115-#define SYS_SCRTCH0 0x49116116-#define SYS_SCRTCH1 0x4a117117-#define SYS_SCRTCH2 0x4b118118-#define SYS_SCRTCH3 0x4c119119-120120-/* PLL registers XLP2XX */121121-#define SYS_CPU_PLL_CTRL0(core) (0x1c0 + (core * 4))122122-#define SYS_CPU_PLL_CTRL1(core) (0x1c1 + (core * 4))123123-#define SYS_CPU_PLL_CTRL2(core) (0x1c2 + (core * 4))124124-#define SYS_CPU_PLL_CTRL3(core) (0x1c3 + (core * 4))125125-#define SYS_PLL_CTRL0 0x240126126-#define SYS_PLL_CTRL1 0x241127127-#define SYS_PLL_CTRL2 0x242128128-#define SYS_PLL_CTRL3 0x243129129-#define SYS_DMC_PLL_CTRL0 0x244130130-#define SYS_DMC_PLL_CTRL1 0x245131131-#define SYS_DMC_PLL_CTRL2 0x246132132-#define SYS_DMC_PLL_CTRL3 0x247133133-134134-#define SYS_PLL_CTRL0_DEVX(x) (0x248 + (x) * 4)135135-#define SYS_PLL_CTRL1_DEVX(x) (0x249 + (x) * 4)136136-#define SYS_PLL_CTRL2_DEVX(x) (0x24a + (x) * 4)137137-#define SYS_PLL_CTRL3_DEVX(x) (0x24b + (x) * 4)138138-139139-#define SYS_CPU_PLL_CHG_CTRL 0x288140140-#define SYS_PLL_CHG_CTRL 0x289141141-#define SYS_CLK_DEV_DIS 0x28a142142-#define SYS_CLK_DEV_SEL 0x28b143143-#define SYS_CLK_DEV_DIV 0x28c144144-#define SYS_CLK_DEV_CHG 0x28d145145-#define SYS_CLK_DEV_SEL_REG 0x28e146146-#define SYS_CLK_DEV_DIV_REG 0x28f147147-#define SYS_CPU_PLL_LOCK 0x29f148148-#define SYS_SYS_PLL_LOCK 0x2a0149149-#define SYS_PLL_MEM_CMD 0x2a1150150-#define SYS_CPU_PLL_MEM_REQ 0x2a2151151-#define SYS_SYS_PLL_MEM_REQ 0x2a3152152-#define SYS_PLL_MEM_STAT 0x2a4153153-154154-/* PLL registers XLP9XX */155155-#define SYS_9XX_CPU_PLL_CTRL0(core) (0xc0 + (core * 4))156156-#define SYS_9XX_CPU_PLL_CTRL1(core) (0xc1 + (core * 4))157157-#define SYS_9XX_CPU_PLL_CTRL2(core) (0xc2 + (core * 4))158158-#define SYS_9XX_CPU_PLL_CTRL3(core) (0xc3 + (core * 4))159159-#define SYS_9XX_DMC_PLL_CTRL0 0x140160160-#define SYS_9XX_DMC_PLL_CTRL1 0x141161161-#define SYS_9XX_DMC_PLL_CTRL2 0x142162162-#define SYS_9XX_DMC_PLL_CTRL3 0x143163163-#define SYS_9XX_PLL_CTRL0 0x144164164-#define SYS_9XX_PLL_CTRL1 0x145165165-#define SYS_9XX_PLL_CTRL2 0x146166166-#define SYS_9XX_PLL_CTRL3 0x147167167-168168-#define SYS_9XX_PLL_CTRL0_DEVX(x) (0x148 + (x) * 4)169169-#define SYS_9XX_PLL_CTRL1_DEVX(x) (0x149 + (x) * 4)170170-#define SYS_9XX_PLL_CTRL2_DEVX(x) (0x14a + (x) * 4)171171-#define SYS_9XX_PLL_CTRL3_DEVX(x) (0x14b + (x) * 4)172172-173173-#define SYS_9XX_CPU_PLL_CHG_CTRL 0x188174174-#define SYS_9XX_PLL_CHG_CTRL 0x189175175-#define SYS_9XX_CLK_DEV_DIS 0x18a176176-#define SYS_9XX_CLK_DEV_SEL 0x18b177177-#define SYS_9XX_CLK_DEV_DIV 0x18d178178-#define SYS_9XX_CLK_DEV_CHG 0x18f179179-180180-#define SYS_9XX_CLK_DEV_SEL_REG 0x1a4181181-#define SYS_9XX_CLK_DEV_DIV_REG 0x1a6182182-183183-/* Registers changed on 9XX */184184-#define SYS_9XX_POWER_ON_RESET_CFG 0x00185185-#define SYS_9XX_CHIP_RESET 0x01186186-#define SYS_9XX_CPU_RESET 0x02187187-#define SYS_9XX_CPU_NONCOHERENT_MODE 0x03188188-189189-/* XLP 9XX fuse block registers */190190-#define FUSE_9XX_DEVCFG6 0xc6191191-192192-#ifndef __ASSEMBLY__193193-194194-#define nlm_read_sys_reg(b, r) nlm_read_reg(b, r)195195-#define nlm_write_sys_reg(b, r, v) nlm_write_reg(b, r, v)196196-#define nlm_get_sys_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \197197- XLP9XX_IO_SYS_OFFSET(node) : XLP_IO_SYS_OFFSET(node))198198-#define nlm_get_sys_regbase(node) (nlm_get_sys_pcibase(node) + XLP_IO_PCI_HDRSZ)199199-200200-/* XLP9XX fuse block */201201-#define nlm_get_fuse_pcibase(node) \202202- nlm_pcicfg_base(XLP9XX_IO_FUSE_OFFSET(node))203203-#define nlm_get_fuse_regbase(node) \204204- (nlm_get_fuse_pcibase(node) + XLP_IO_PCI_HDRSZ)205205-206206-#define nlm_get_clock_pcibase(node) \207207- nlm_pcicfg_base(XLP9XX_IO_CLOCK_OFFSET(node))208208-#define nlm_get_clock_regbase(node) \209209- (nlm_get_clock_pcibase(node) + XLP_IO_PCI_HDRSZ)210210-211211-unsigned int nlm_get_pic_frequency(int node);212212-#endif213213-#endif
-192
arch/mips/include/asm/netlogic/xlp-hal/uart.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef __XLP_HAL_UART_H__3636-#define __XLP_HAL_UART_H__3737-3838-/* UART Specific registers */3939-#define UART_RX_DATA 0x004040-#define UART_TX_DATA 0x004141-4242-#define UART_INT_EN 0x014343-#define UART_INT_ID 0x024444-#define UART_FIFO_CTL 0x024545-#define UART_LINE_CTL 0x034646-#define UART_MODEM_CTL 0x044747-#define UART_LINE_STS 0x054848-#define UART_MODEM_STS 0x064949-5050-#define UART_DIVISOR0 0x005151-#define UART_DIVISOR1 0x015252-5353-#define BASE_BAUD (XLP_IO_CLK/16)5454-#define BAUD_DIVISOR(baud) (BASE_BAUD / baud)5555-5656-/* LCR mask values */5757-#define LCR_5BITS 0x005858-#define LCR_6BITS 0x015959-#define LCR_7BITS 0x026060-#define LCR_8BITS 0x036161-#define LCR_STOPB 0x046262-#define LCR_PENAB 0x086363-#define LCR_PODD 0x006464-#define LCR_PEVEN 0x106565-#define LCR_PONE 0x206666-#define LCR_PZERO 0x306767-#define LCR_SBREAK 0x406868-#define LCR_EFR_ENABLE 0xbf6969-#define LCR_DLAB 0x807070-7171-/* MCR mask values */7272-#define MCR_DTR 0x017373-#define MCR_RTS 0x027474-#define MCR_DRS 0x047575-#define MCR_IE 0x087676-#define MCR_LOOPBACK 0x107777-7878-/* FCR mask values */7979-#define FCR_RCV_RST 0x028080-#define FCR_XMT_RST 0x048181-#define FCR_RX_LOW 0x008282-#define FCR_RX_MEDL 0x408383-#define FCR_RX_MEDH 0x808484-#define FCR_RX_HIGH 0xc08585-8686-/* IER mask values */8787-#define IER_ERXRDY 0x18888-#define IER_ETXRDY 0x28989-#define IER_ERLS 0x49090-#define IER_EMSC 0x89191-9292-#if !defined(LOCORE) && !defined(__ASSEMBLY__)9393-9494-#define nlm_read_uart_reg(b, r) nlm_read_reg(b, r)9595-#define nlm_write_uart_reg(b, r, v) nlm_write_reg(b, r, v)9696-#define nlm_get_uart_pcibase(node, inst) \9797- nlm_pcicfg_base(cpu_is_xlp9xx() ? XLP9XX_IO_UART_OFFSET(node) : \9898- XLP_IO_UART_OFFSET(node, inst))9999-#define nlm_get_uart_regbase(node, inst) \100100- (nlm_get_uart_pcibase(node, inst) + XLP_IO_PCI_HDRSZ)101101-102102-static inline void103103-nlm_uart_set_baudrate(uint64_t base, int baud)104104-{105105- uint32_t lcr;106106-107107- lcr = nlm_read_uart_reg(base, UART_LINE_CTL);108108-109109- /* enable divisor register, and write baud values */110110- nlm_write_uart_reg(base, UART_LINE_CTL, lcr | (1 << 7));111111- nlm_write_uart_reg(base, UART_DIVISOR0,112112- (BAUD_DIVISOR(baud) & 0xff));113113- nlm_write_uart_reg(base, UART_DIVISOR1,114114- ((BAUD_DIVISOR(baud) >> 8) & 0xff));115115-116116- /* restore default lcr */117117- nlm_write_uart_reg(base, UART_LINE_CTL, lcr);118118-}119119-120120-static inline void121121-nlm_uart_outbyte(uint64_t base, char c)122122-{123123- uint32_t lsr;124124-125125- for (;;) {126126- lsr = nlm_read_uart_reg(base, UART_LINE_STS);127127- if (lsr & 0x20)128128- break;129129- }130130-131131- nlm_write_uart_reg(base, UART_TX_DATA, (int)c);132132-}133133-134134-static inline char135135-nlm_uart_inbyte(uint64_t base)136136-{137137- int data, lsr;138138-139139- for (;;) {140140- lsr = nlm_read_uart_reg(base, UART_LINE_STS);141141- if (lsr & 0x80) { /* parity/frame/break-error - push a zero */142142- data = 0;143143- break;144144- }145145- if (lsr & 0x01) { /* Rx data */146146- data = nlm_read_uart_reg(base, UART_RX_DATA);147147- break;148148- }149149- }150150-151151- return (char)data;152152-}153153-154154-static inline int155155-nlm_uart_init(uint64_t base, int baud, int databits, int stopbits,156156- int parity, int int_en, int loopback)157157-{158158- uint32_t lcr;159159-160160- lcr = 0;161161- if (databits >= 8)162162- lcr |= LCR_8BITS;163163- else if (databits == 7)164164- lcr |= LCR_7BITS;165165- else if (databits == 6)166166- lcr |= LCR_6BITS;167167- else168168- lcr |= LCR_5BITS;169169-170170- if (stopbits > 1)171171- lcr |= LCR_STOPB;172172-173173- lcr |= parity << 3;174174-175175- /* setup default lcr */176176- nlm_write_uart_reg(base, UART_LINE_CTL, lcr);177177-178178- /* Reset the FIFOs */179179- nlm_write_uart_reg(base, UART_LINE_CTL, FCR_RCV_RST | FCR_XMT_RST);180180-181181- nlm_uart_set_baudrate(base, baud);182182-183183- if (loopback)184184- nlm_write_uart_reg(base, UART_MODEM_CTL, 0x1f);185185-186186- if (int_en)187187- nlm_write_uart_reg(base, UART_INT_EN, IER_ERXRDY | IER_ETXRDY);188188-189189- return 0;190190-}191191-#endif /* !LOCORE && !__ASSEMBLY__ */192192-#endif /* __XLP_HAL_UART_H__ */
-119
arch/mips/include/asm/netlogic/xlp-hal/xlp.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _NLM_HAL_XLP_H3636-#define _NLM_HAL_XLP_H3737-3838-#define PIC_UART_0_IRQ 173939-#define PIC_UART_1_IRQ 184040-4141-#define PIC_PCIE_LINK_LEGACY_IRQ_BASE 194242-#define PIC_PCIE_LINK_LEGACY_IRQ(i) (19 + (i))4343-4444-#define PIC_EHCI_0_IRQ 234545-#define PIC_EHCI_1_IRQ 244646-#define PIC_OHCI_0_IRQ 254747-#define PIC_OHCI_1_IRQ 264848-#define PIC_OHCI_2_IRQ 274949-#define PIC_OHCI_3_IRQ 285050-#define PIC_2XX_XHCI_0_IRQ 235151-#define PIC_2XX_XHCI_1_IRQ 245252-#define PIC_2XX_XHCI_2_IRQ 255353-#define PIC_9XX_XHCI_0_IRQ 235454-#define PIC_9XX_XHCI_1_IRQ 245555-#define PIC_9XX_XHCI_2_IRQ 255656-5757-#define PIC_MMC_IRQ 295858-#define PIC_I2C_0_IRQ 305959-#define PIC_I2C_1_IRQ 316060-#define PIC_I2C_2_IRQ 326161-#define PIC_I2C_3_IRQ 336262-#define PIC_SPI_IRQ 346363-#define PIC_NAND_IRQ 376464-#define PIC_SATA_IRQ 386565-#define PIC_GPIO_IRQ 396666-6767-#define PIC_PCIE_LINK_MSI_IRQ_BASE 44 /* 44 - 47 MSI IRQ */6868-#define PIC_PCIE_LINK_MSI_IRQ(i) (44 + (i))6969-7070-/* MSI-X with second link-level dispatch */7171-#define PIC_PCIE_MSIX_IRQ_BASE 48 /* 48 - 51 MSI-X IRQ */7272-#define PIC_PCIE_MSIX_IRQ(i) (48 + (i))7373-7474-/* XLP9xx and XLP8xx has 128 and 32 MSIX vectors respectively */7575-#define NLM_MSIX_VEC_BASE 96 /* 96 - 223 - MSIX mapped */7676-#define NLM_MSI_VEC_BASE 224 /* 224 -351 - MSI mapped */7777-7878-#define NLM_PIC_INDIRECT_VEC_BASE 5127979-#define NLM_GPIO_VEC_BASE 7688080-8181-#define PIC_IRQ_BASE 88282-#define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE8383-#define PIC_IRT_LAST_IRQ 638484-8585-#ifndef __ASSEMBLY__8686-8787-/* SMP support functions */8888-void xlp_boot_core0_siblings(void);8989-void xlp_wakeup_secondary_cpus(void);9090-9191-void xlp_mmu_init(void);9292-void nlm_hal_init(void);9393-int nlm_get_dram_map(int node, uint64_t *dram_map, int nentries);9494-9595-struct pci_dev;9696-int xlp_socdev_to_node(const struct pci_dev *dev);9797-9898-/* Device tree related */9999-void xlp_early_init_devtree(void);100100-void *xlp_dt_init(void *fdtp);101101-102102-static inline int cpu_is_xlpii(void)103103-{104104- int chip = read_c0_prid() & PRID_IMP_MASK;105105-106106- return chip == PRID_IMP_NETLOGIC_XLP2XX ||107107- chip == PRID_IMP_NETLOGIC_XLP9XX ||108108- chip == PRID_IMP_NETLOGIC_XLP5XX;109109-}110110-111111-static inline int cpu_is_xlp9xx(void)112112-{113113- int chip = read_c0_prid() & PRID_IMP_MASK;114114-115115- return chip == PRID_IMP_NETLOGIC_XLP9XX ||116116- chip == PRID_IMP_NETLOGIC_XLP5XX;117117-}118118-#endif /* !__ASSEMBLY__ */119119-#endif /* _ASM_NLM_XLP_H */
-104
arch/mips/include/asm/netlogic/xlr/bridge.h
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-#ifndef _ASM_NLM_BRIDGE_H_3535-#define _ASM_NLM_BRIDGE_H_3636-3737-#define BRIDGE_DRAM_0_BAR 03838-#define BRIDGE_DRAM_1_BAR 13939-#define BRIDGE_DRAM_2_BAR 24040-#define BRIDGE_DRAM_3_BAR 34141-#define BRIDGE_DRAM_4_BAR 44242-#define BRIDGE_DRAM_5_BAR 54343-#define BRIDGE_DRAM_6_BAR 64444-#define BRIDGE_DRAM_7_BAR 74545-#define BRIDGE_DRAM_CHN_0_MTR_0_BAR 84646-#define BRIDGE_DRAM_CHN_0_MTR_1_BAR 94747-#define BRIDGE_DRAM_CHN_0_MTR_2_BAR 104848-#define BRIDGE_DRAM_CHN_0_MTR_3_BAR 114949-#define BRIDGE_DRAM_CHN_0_MTR_4_BAR 125050-#define BRIDGE_DRAM_CHN_0_MTR_5_BAR 135151-#define BRIDGE_DRAM_CHN_0_MTR_6_BAR 145252-#define BRIDGE_DRAM_CHN_0_MTR_7_BAR 155353-#define BRIDGE_DRAM_CHN_1_MTR_0_BAR 165454-#define BRIDGE_DRAM_CHN_1_MTR_1_BAR 175555-#define BRIDGE_DRAM_CHN_1_MTR_2_BAR 185656-#define BRIDGE_DRAM_CHN_1_MTR_3_BAR 195757-#define BRIDGE_DRAM_CHN_1_MTR_4_BAR 205858-#define BRIDGE_DRAM_CHN_1_MTR_5_BAR 215959-#define BRIDGE_DRAM_CHN_1_MTR_6_BAR 226060-#define BRIDGE_DRAM_CHN_1_MTR_7_BAR 236161-#define BRIDGE_CFG_BAR 246262-#define BRIDGE_PHNX_IO_BAR 256363-#define BRIDGE_FLASH_BAR 266464-#define BRIDGE_SRAM_BAR 276565-#define BRIDGE_HTMEM_BAR 286666-#define BRIDGE_HTINT_BAR 296767-#define BRIDGE_HTPIC_BAR 306868-#define BRIDGE_HTSM_BAR 316969-#define BRIDGE_HTIO_BAR 327070-#define BRIDGE_HTCFG_BAR 337171-#define BRIDGE_PCIXCFG_BAR 347272-#define BRIDGE_PCIXMEM_BAR 357373-#define BRIDGE_PCIXIO_BAR 367474-#define BRIDGE_DEVICE_MASK 377575-#define BRIDGE_AERR_INTR_LOG1 387676-#define BRIDGE_AERR_INTR_LOG2 397777-#define BRIDGE_AERR_INTR_LOG3 407878-#define BRIDGE_AERR_DEV_STAT 417979-#define BRIDGE_AERR1_LOG1 428080-#define BRIDGE_AERR1_LOG2 438181-#define BRIDGE_AERR1_LOG3 448282-#define BRIDGE_AERR1_DEV_STAT 458383-#define BRIDGE_AERR_INTR_EN 468484-#define BRIDGE_AERR_UPG 478585-#define BRIDGE_AERR_CLEAR 488686-#define BRIDGE_AERR1_CLEAR 498787-#define BRIDGE_SBE_COUNTS 508888-#define BRIDGE_DBE_COUNTS 518989-#define BRIDGE_BITERR_INT_EN 529090-9191-#define BRIDGE_SYS2IO_CREDITS 539292-#define BRIDGE_EVNT_CNT_CTRL1 549393-#define BRIDGE_EVNT_COUNTER1 559494-#define BRIDGE_EVNT_CNT_CTRL2 569595-#define BRIDGE_EVNT_COUNTER2 579696-#define BRIDGE_RESERVED1 589797-9898-#define BRIDGE_DEFEATURE 599999-#define BRIDGE_SCRATCH0 60100100-#define BRIDGE_SCRATCH1 61101101-#define BRIDGE_SCRATCH2 62102102-#define BRIDGE_SCRATCH3 63103103-104104-#endif
-55
arch/mips/include/asm/netlogic/xlr/flash.h
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-#ifndef _ASM_NLM_FLASH_H_3535-#define _ASM_NLM_FLASH_H_3636-3737-#define FLASH_CSBASE_ADDR(cs) (cs)3838-#define FLASH_CSADDR_MASK(cs) (0x10 + (cs))3939-#define FLASH_CSDEV_PARM(cs) (0x20 + (cs))4040-#define FLASH_CSTIME_PARMA(cs) (0x30 + (cs))4141-#define FLASH_CSTIME_PARMB(cs) (0x40 + (cs))4242-4343-#define FLASH_INT_MASK 0x504444-#define FLASH_INT_STATUS 0x604545-#define FLASH_ERROR_STATUS 0x704646-#define FLASH_ERROR_ADDR 0x804747-4848-#define FLASH_NAND_CLE(cs) (0x90 + (cs))4949-#define FLASH_NAND_ALE(cs) (0xa0 + (cs))5050-5151-#define FLASH_NAND_CSDEV_PARAM 0x000041e65252-#define FLASH_NAND_CSTIME_PARAMA 0x4f400e225353-#define FLASH_NAND_CSTIME_PARAMB 0x000083cf5454-5555-#endif
-365
arch/mips/include/asm/netlogic/xlr/fmn.h
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _NLM_FMN_H_3636-#define _NLM_FMN_H_3737-3838-#include <asm/netlogic/mips-extns.h> /* for COP2 access */3939-4040-/* Station IDs */4141-#define FMN_STNID_CPU0 0x004242-#define FMN_STNID_CPU1 0x084343-#define FMN_STNID_CPU2 0x104444-#define FMN_STNID_CPU3 0x184545-#define FMN_STNID_CPU4 0x204646-#define FMN_STNID_CPU5 0x284747-#define FMN_STNID_CPU6 0x304848-#define FMN_STNID_CPU7 0x384949-5050-#define FMN_STNID_XGS0_TX 645151-#define FMN_STNID_XMAC0_00_TX 645252-#define FMN_STNID_XMAC0_01_TX 655353-#define FMN_STNID_XMAC0_02_TX 665454-#define FMN_STNID_XMAC0_03_TX 675555-#define FMN_STNID_XMAC0_04_TX 685656-#define FMN_STNID_XMAC0_05_TX 695757-#define FMN_STNID_XMAC0_06_TX 705858-#define FMN_STNID_XMAC0_07_TX 715959-#define FMN_STNID_XMAC0_08_TX 726060-#define FMN_STNID_XMAC0_09_TX 736161-#define FMN_STNID_XMAC0_10_TX 746262-#define FMN_STNID_XMAC0_11_TX 756363-#define FMN_STNID_XMAC0_12_TX 766464-#define FMN_STNID_XMAC0_13_TX 776565-#define FMN_STNID_XMAC0_14_TX 786666-#define FMN_STNID_XMAC0_15_TX 796767-6868-#define FMN_STNID_XGS1_TX 806969-#define FMN_STNID_XMAC1_00_TX 807070-#define FMN_STNID_XMAC1_01_TX 817171-#define FMN_STNID_XMAC1_02_TX 827272-#define FMN_STNID_XMAC1_03_TX 837373-#define FMN_STNID_XMAC1_04_TX 847474-#define FMN_STNID_XMAC1_05_TX 857575-#define FMN_STNID_XMAC1_06_TX 867676-#define FMN_STNID_XMAC1_07_TX 877777-#define FMN_STNID_XMAC1_08_TX 887878-#define FMN_STNID_XMAC1_09_TX 897979-#define FMN_STNID_XMAC1_10_TX 908080-#define FMN_STNID_XMAC1_11_TX 918181-#define FMN_STNID_XMAC1_12_TX 928282-#define FMN_STNID_XMAC1_13_TX 938383-#define FMN_STNID_XMAC1_14_TX 948484-#define FMN_STNID_XMAC1_15_TX 958585-8686-#define FMN_STNID_GMAC 968787-#define FMN_STNID_GMACJFR_0 968888-#define FMN_STNID_GMACRFR_0 978989-#define FMN_STNID_GMACTX0 989090-#define FMN_STNID_GMACTX1 999191-#define FMN_STNID_GMACTX2 1009292-#define FMN_STNID_GMACTX3 1019393-#define FMN_STNID_GMACJFR_1 1029494-#define FMN_STNID_GMACRFR_1 1039595-9696-#define FMN_STNID_DMA 1049797-#define FMN_STNID_DMA_0 1049898-#define FMN_STNID_DMA_1 1059999-#define FMN_STNID_DMA_2 106100100-#define FMN_STNID_DMA_3 107101101-102102-#define FMN_STNID_XGS0FR 112103103-#define FMN_STNID_XMAC0JFR 112104104-#define FMN_STNID_XMAC0RFR 113105105-106106-#define FMN_STNID_XGS1FR 114107107-#define FMN_STNID_XMAC1JFR 114108108-#define FMN_STNID_XMAC1RFR 115109109-#define FMN_STNID_SEC 120110110-#define FMN_STNID_SEC0 120111111-#define FMN_STNID_SEC1 121112112-#define FMN_STNID_SEC2 122113113-#define FMN_STNID_SEC3 123114114-#define FMN_STNID_PK0 124115115-#define FMN_STNID_SEC_RSA 124116116-#define FMN_STNID_SEC_RSVD0 125117117-#define FMN_STNID_SEC_RSVD1 126118118-#define FMN_STNID_SEC_RSVD2 127119119-120120-#define FMN_STNID_GMAC1 80121121-#define FMN_STNID_GMAC1_FR_0 81122122-#define FMN_STNID_GMAC1_TX0 82123123-#define FMN_STNID_GMAC1_TX1 83124124-#define FMN_STNID_GMAC1_TX2 84125125-#define FMN_STNID_GMAC1_TX3 85126126-#define FMN_STNID_GMAC1_FR_1 87127127-#define FMN_STNID_GMAC0 96128128-#define FMN_STNID_GMAC0_FR_0 97129129-#define FMN_STNID_GMAC0_TX0 98130130-#define FMN_STNID_GMAC0_TX1 99131131-#define FMN_STNID_GMAC0_TX2 100132132-#define FMN_STNID_GMAC0_TX3 101133133-#define FMN_STNID_GMAC0_FR_1 103134134-#define FMN_STNID_CMP_0 108135135-#define FMN_STNID_CMP_1 109136136-#define FMN_STNID_CMP_2 110137137-#define FMN_STNID_CMP_3 111138138-#define FMN_STNID_PCIE_0 116139139-#define FMN_STNID_PCIE_1 117140140-#define FMN_STNID_PCIE_2 118141141-#define FMN_STNID_PCIE_3 119142142-#define FMN_STNID_XLS_PK0 121143143-144144-#define nlm_read_c2_cc0(s) __read_32bit_c2_register($16, s)145145-#define nlm_read_c2_cc1(s) __read_32bit_c2_register($17, s)146146-#define nlm_read_c2_cc2(s) __read_32bit_c2_register($18, s)147147-#define nlm_read_c2_cc3(s) __read_32bit_c2_register($19, s)148148-#define nlm_read_c2_cc4(s) __read_32bit_c2_register($20, s)149149-#define nlm_read_c2_cc5(s) __read_32bit_c2_register($21, s)150150-#define nlm_read_c2_cc6(s) __read_32bit_c2_register($22, s)151151-#define nlm_read_c2_cc7(s) __read_32bit_c2_register($23, s)152152-#define nlm_read_c2_cc8(s) __read_32bit_c2_register($24, s)153153-#define nlm_read_c2_cc9(s) __read_32bit_c2_register($25, s)154154-#define nlm_read_c2_cc10(s) __read_32bit_c2_register($26, s)155155-#define nlm_read_c2_cc11(s) __read_32bit_c2_register($27, s)156156-#define nlm_read_c2_cc12(s) __read_32bit_c2_register($28, s)157157-#define nlm_read_c2_cc13(s) __read_32bit_c2_register($29, s)158158-#define nlm_read_c2_cc14(s) __read_32bit_c2_register($30, s)159159-#define nlm_read_c2_cc15(s) __read_32bit_c2_register($31, s)160160-161161-#define nlm_write_c2_cc0(s, v) __write_32bit_c2_register($16, s, v)162162-#define nlm_write_c2_cc1(s, v) __write_32bit_c2_register($17, s, v)163163-#define nlm_write_c2_cc2(s, v) __write_32bit_c2_register($18, s, v)164164-#define nlm_write_c2_cc3(s, v) __write_32bit_c2_register($19, s, v)165165-#define nlm_write_c2_cc4(s, v) __write_32bit_c2_register($20, s, v)166166-#define nlm_write_c2_cc5(s, v) __write_32bit_c2_register($21, s, v)167167-#define nlm_write_c2_cc6(s, v) __write_32bit_c2_register($22, s, v)168168-#define nlm_write_c2_cc7(s, v) __write_32bit_c2_register($23, s, v)169169-#define nlm_write_c2_cc8(s, v) __write_32bit_c2_register($24, s, v)170170-#define nlm_write_c2_cc9(s, v) __write_32bit_c2_register($25, s, v)171171-#define nlm_write_c2_cc10(s, v) __write_32bit_c2_register($26, s, v)172172-#define nlm_write_c2_cc11(s, v) __write_32bit_c2_register($27, s, v)173173-#define nlm_write_c2_cc12(s, v) __write_32bit_c2_register($28, s, v)174174-#define nlm_write_c2_cc13(s, v) __write_32bit_c2_register($29, s, v)175175-#define nlm_write_c2_cc14(s, v) __write_32bit_c2_register($30, s, v)176176-#define nlm_write_c2_cc15(s, v) __write_32bit_c2_register($31, s, v)177177-178178-#define nlm_read_c2_status0() __read_32bit_c2_register($2, 0)179179-#define nlm_write_c2_status0(v) __write_32bit_c2_register($2, 0, v)180180-#define nlm_read_c2_status1() __read_32bit_c2_register($2, 1)181181-#define nlm_write_c2_status1(v) __write_32bit_c2_register($2, 1, v)182182-#define nlm_read_c2_status(sel) __read_32bit_c2_register($2, 0)183183-#define nlm_read_c2_config() __read_32bit_c2_register($3, 0)184184-#define nlm_write_c2_config(v) __write_32bit_c2_register($3, 0, v)185185-#define nlm_read_c2_bucksize(b) __read_32bit_c2_register($4, b)186186-#define nlm_write_c2_bucksize(b, v) __write_32bit_c2_register($4, b, v)187187-188188-#define nlm_read_c2_rx_msg0() __read_64bit_c2_register($1, 0)189189-#define nlm_read_c2_rx_msg1() __read_64bit_c2_register($1, 1)190190-#define nlm_read_c2_rx_msg2() __read_64bit_c2_register($1, 2)191191-#define nlm_read_c2_rx_msg3() __read_64bit_c2_register($1, 3)192192-193193-#define nlm_write_c2_tx_msg0(v) __write_64bit_c2_register($0, 0, v)194194-#define nlm_write_c2_tx_msg1(v) __write_64bit_c2_register($0, 1, v)195195-#define nlm_write_c2_tx_msg2(v) __write_64bit_c2_register($0, 2, v)196196-#define nlm_write_c2_tx_msg3(v) __write_64bit_c2_register($0, 3, v)197197-198198-#define FMN_STN_RX_QSIZE 256199199-#define FMN_NSTATIONS 128200200-#define FMN_CORE_NBUCKETS 8201201-202202-static inline void nlm_msgsnd(unsigned int stid)203203-{204204- __asm__ volatile (205205- ".set push\n"206206- ".set noreorder\n"207207- ".set noat\n"208208- "move $1, %0\n"209209- "c2 0x10001\n" /* msgsnd $1 */210210- ".set pop\n"211211- : : "r" (stid) : "$1"212212- );213213-}214214-215215-static inline void nlm_msgld(unsigned int pri)216216-{217217- __asm__ volatile (218218- ".set push\n"219219- ".set noreorder\n"220220- ".set noat\n"221221- "move $1, %0\n"222222- "c2 0x10002\n" /* msgld $1 */223223- ".set pop\n"224224- : : "r" (pri) : "$1"225225- );226226-}227227-228228-static inline void nlm_msgwait(unsigned int mask)229229-{230230- __asm__ volatile (231231- ".set push\n"232232- ".set noreorder\n"233233- ".set noat\n"234234- "move $8, %0\n"235235- "c2 0x10003\n" /* msgwait $1 */236236- ".set pop\n"237237- : : "r" (mask) : "$1"238238- );239239-}240240-241241-/*242242- * Disable interrupts and enable COP2 access243243- */244244-static inline uint32_t nlm_cop2_enable_irqsave(void)245245-{246246- uint32_t sr = read_c0_status();247247-248248- write_c0_status((sr & ~ST0_IE) | ST0_CU2);249249- return sr;250250-}251251-252252-static inline void nlm_cop2_disable_irqrestore(uint32_t sr)253253-{254254- write_c0_status(sr);255255-}256256-257257-static inline void nlm_fmn_setup_intr(int irq, unsigned int tmask)258258-{259259- uint32_t config;260260-261261- config = (1 << 24) /* interrupt water mark - 1 msg */262262- | (irq << 16) /* irq */263263- | (tmask << 8) /* thread mask */264264- | 0x2; /* enable watermark intr, disable empty intr */265265- nlm_write_c2_config(config);266266-}267267-268268-struct nlm_fmn_msg {269269- uint64_t msg0;270270- uint64_t msg1;271271- uint64_t msg2;272272- uint64_t msg3;273273-};274274-275275-static inline int nlm_fmn_send(unsigned int size, unsigned int code,276276- unsigned int stid, struct nlm_fmn_msg *msg)277277-{278278- unsigned int dest;279279- uint32_t status;280280- int i;281281-282282- /*283283- * Make sure that all the writes pending at the cpu are flushed.284284- * Any writes pending on CPU will not be see by devices. L1/L2285285- * caches are coherent with IO, so no cache flush needed.286286- */287287- __asm __volatile("sync");288288-289289- /* Load TX message buffers */290290- nlm_write_c2_tx_msg0(msg->msg0);291291- nlm_write_c2_tx_msg1(msg->msg1);292292- nlm_write_c2_tx_msg2(msg->msg2);293293- nlm_write_c2_tx_msg3(msg->msg3);294294- dest = ((size - 1) << 16) | (code << 8) | stid;295295-296296- /*297297- * Retry a few times on credit fail, this should be a298298- * transient condition, unless there is a configuration299299- * failure, or the receiver is stuck.300300- */301301- for (i = 0; i < 8; i++) {302302- nlm_msgsnd(dest);303303- status = nlm_read_c2_status0();304304- if ((status & 0x4) == 0)305305- return 0;306306- }307307-308308- /* If there is a credit failure, return error */309309- return status & 0x06;310310-}311311-312312-static inline int nlm_fmn_receive(int bucket, int *size, int *code, int *stid,313313- struct nlm_fmn_msg *msg)314314-{315315- uint32_t status, tmp;316316-317317- nlm_msgld(bucket);318318-319319- /* wait for load pending to clear */320320- do {321321- status = nlm_read_c2_status0();322322- } while ((status & 0x08) != 0);323323-324324- /* receive error bits */325325- tmp = status & 0x30;326326- if (tmp != 0)327327- return tmp;328328-329329- *size = ((status & 0xc0) >> 6) + 1;330330- *code = (status & 0xff00) >> 8;331331- *stid = (status & 0x7f0000) >> 16;332332- msg->msg0 = nlm_read_c2_rx_msg0();333333- msg->msg1 = nlm_read_c2_rx_msg1();334334- msg->msg2 = nlm_read_c2_rx_msg2();335335- msg->msg3 = nlm_read_c2_rx_msg3();336336-337337- return 0;338338-}339339-340340-struct xlr_fmn_info {341341- int num_buckets;342342- int start_stn_id;343343- int end_stn_id;344344- int credit_config[128];345345-};346346-347347-struct xlr_board_fmn_config {348348- int bucket_size[128]; /* size of buckets for all stations */349349- struct xlr_fmn_info cpu[8];350350- struct xlr_fmn_info gmac[2];351351- struct xlr_fmn_info dma;352352- struct xlr_fmn_info cmp;353353- struct xlr_fmn_info sae;354354- struct xlr_fmn_info xgmac[2];355355-};356356-357357-extern int nlm_register_fmn_handler(int start, int end,358358- void (*fn)(int, int, int, int, struct nlm_fmn_msg *, void *),359359- void *arg);360360-extern void xlr_percpu_fmn_init(void);361361-extern void nlm_setup_fmn_irq(void);362362-extern void xlr_board_info_setup(void);363363-364364-extern struct xlr_board_fmn_config xlr_board_fmn_config;365365-#endif
-74
arch/mips/include/asm/netlogic/xlr/gpio.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_GPIO_H3636-#define _ASM_NLM_GPIO_H3737-3838-#define GPIO_INT_EN_REG 03939-#define GPIO_INPUT_INVERSION_REG 14040-#define GPIO_IO_DIR_REG 24141-#define GPIO_IO_DATA_WR_REG 34242-#define GPIO_IO_DATA_RD_REG 44343-4444-#define GPIO_SWRESET_REG 84545-#define GPIO_DRAM1_CNTRL_REG 94646-#define GPIO_DRAM1_RATIO_REG 104747-#define GPIO_DRAM1_RESET_REG 114848-#define GPIO_DRAM1_STATUS_REG 124949-#define GPIO_DRAM2_CNTRL_REG 135050-#define GPIO_DRAM2_RATIO_REG 145151-#define GPIO_DRAM2_RESET_REG 155252-#define GPIO_DRAM2_STATUS_REG 165353-5454-#define GPIO_PWRON_RESET_CFG_REG 215555-#define GPIO_BIST_ALL_GO_STATUS_REG 245656-#define GPIO_BIST_CPU_GO_STATUS_REG 255757-#define GPIO_BIST_DEV_GO_STATUS_REG 265858-5959-#define GPIO_FUSE_BANK_REG 356060-#define GPIO_CPU_RESET_REG 406161-#define GPIO_RNG_REG 436262-6363-#define PWRON_RESET_PCMCIA_BOOT 176464-6565-#define GPIO_LED_BITMAP 0x17000006666-#define GPIO_LED_0_SHIFT 206767-#define GPIO_LED_1_SHIFT 246868-6969-#define GPIO_LED_OUTPUT_CODE_RESET 0x017070-#define GPIO_LED_OUTPUT_CODE_HARD_RESET 0x027171-#define GPIO_LED_OUTPUT_CODE_SOFT_RESET 0x037272-#define GPIO_LED_OUTPUT_CODE_MAIN 0x047373-7474-#endif
-109
arch/mips/include/asm/netlogic/xlr/iomap.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_IOMAP_H3636-#define _ASM_NLM_IOMAP_H3737-3838-#define DEFAULT_NETLOGIC_IO_BASE CKSEG1ADDR(0x1ef00000)3939-#define NETLOGIC_IO_DDR2_CHN0_OFFSET 0x010004040-#define NETLOGIC_IO_DDR2_CHN1_OFFSET 0x020004141-#define NETLOGIC_IO_DDR2_CHN2_OFFSET 0x030004242-#define NETLOGIC_IO_DDR2_CHN3_OFFSET 0x040004343-#define NETLOGIC_IO_PIC_OFFSET 0x080004444-#define NETLOGIC_IO_UART_0_OFFSET 0x140004545-#define NETLOGIC_IO_UART_1_OFFSET 0x151004646-4747-#define NETLOGIC_IO_SIZE 0x10004848-4949-#define NETLOGIC_IO_BRIDGE_OFFSET 0x000005050-5151-#define NETLOGIC_IO_RLD2_CHN0_OFFSET 0x050005252-#define NETLOGIC_IO_RLD2_CHN1_OFFSET 0x060005353-5454-#define NETLOGIC_IO_SRAM_OFFSET 0x070005555-5656-#define NETLOGIC_IO_PCIX_OFFSET 0x090005757-#define NETLOGIC_IO_HT_OFFSET 0x0A0005858-5959-#define NETLOGIC_IO_SECURITY_OFFSET 0x0B0006060-6161-#define NETLOGIC_IO_GMAC_0_OFFSET 0x0C0006262-#define NETLOGIC_IO_GMAC_1_OFFSET 0x0D0006363-#define NETLOGIC_IO_GMAC_2_OFFSET 0x0E0006464-#define NETLOGIC_IO_GMAC_3_OFFSET 0x0F0006565-6666-/* XLS devices */6767-#define NETLOGIC_IO_GMAC_4_OFFSET 0x200006868-#define NETLOGIC_IO_GMAC_5_OFFSET 0x210006969-#define NETLOGIC_IO_GMAC_6_OFFSET 0x220007070-#define NETLOGIC_IO_GMAC_7_OFFSET 0x230007171-7272-#define NETLOGIC_IO_PCIE_0_OFFSET 0x1E0007373-#define NETLOGIC_IO_PCIE_1_OFFSET 0x1F0007474-#define NETLOGIC_IO_SRIO_0_OFFSET 0x1E0007575-#define NETLOGIC_IO_SRIO_1_OFFSET 0x1F0007676-7777-#define NETLOGIC_IO_USB_0_OFFSET 0x240007878-#define NETLOGIC_IO_USB_1_OFFSET 0x250007979-8080-#define NETLOGIC_IO_COMP_OFFSET 0x1D0008181-/* end XLS devices */8282-8383-/* XLR devices */8484-#define NETLOGIC_IO_SPI4_0_OFFSET 0x100008585-#define NETLOGIC_IO_XGMAC_0_OFFSET 0x110008686-#define NETLOGIC_IO_SPI4_1_OFFSET 0x120008787-#define NETLOGIC_IO_XGMAC_1_OFFSET 0x130008888-/* end XLR devices */8989-9090-#define NETLOGIC_IO_I2C_0_OFFSET 0x160009191-#define NETLOGIC_IO_I2C_1_OFFSET 0x170009292-9393-#define NETLOGIC_IO_GPIO_OFFSET 0x180009494-#define NETLOGIC_IO_FLASH_OFFSET 0x190009595-#define NETLOGIC_IO_TB_OFFSET 0x1C0009696-9797-#define NETLOGIC_CPLD_OFFSET KSEG1ADDR(0x1d840000)9898-9999-/*100100- * Base Address (Virtual) of the PCI Config address space101101- * For now, choose 256M phys in kseg1 = 0xA0000000 + (1<<28)102102- * Config space spans 256 (num of buses) * 256 (num functions) * 256 bytes103103- * ie 1<<24 = 16M104104- */105105-#define DEFAULT_PCI_CONFIG_BASE 0x18000000106106-#define DEFAULT_HT_TYPE0_CFG_BASE 0x16000000107107-#define DEFAULT_HT_TYPE1_CFG_BASE 0x17000000108108-109109-#endif
-84
arch/mips/include/asm/netlogic/xlr/msidef.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef ASM_RMI_MSIDEF_H3636-#define ASM_RMI_MSIDEF_H3737-3838-/*3939- * Constants for Intel APIC based MSI messages.4040- * Adapted for the RMI XLR using identical defines4141- */4242-4343-/*4444- * Shifts for MSI data4545- */4646-4747-#define MSI_DATA_VECTOR_SHIFT 04848-#define MSI_DATA_VECTOR_MASK 0x000000ff4949-#define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & \5050- MSI_DATA_VECTOR_MASK)5151-5252-#define MSI_DATA_DELIVERY_MODE_SHIFT 85353-#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT)5454-#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT)5555-5656-#define MSI_DATA_LEVEL_SHIFT 145757-#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)5858-#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)5959-6060-#define MSI_DATA_TRIGGER_SHIFT 156161-#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)6262-#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)6363-6464-/*6565- * Shift/mask fields for msi address6666- */6767-6868-#define MSI_ADDR_BASE_HI 06969-#define MSI_ADDR_BASE_LO 0xfee000007070-7171-#define MSI_ADDR_DEST_MODE_SHIFT 27272-#define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT)7373-#define MSI_ADDR_DEST_MODE_LOGICAL (1 << MSI_ADDR_DEST_MODE_SHIFT)7474-7575-#define MSI_ADDR_REDIRECTION_SHIFT 37676-#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT)7777-#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT)7878-7979-#define MSI_ADDR_DEST_ID_SHIFT 128080-#define MSI_ADDR_DEST_ID_MASK 0x00ffff08181-#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \8282- MSI_ADDR_DEST_ID_MASK)8383-8484-#endif /* ASM_RMI_MSIDEF_H */
-306
arch/mips/include/asm/netlogic/xlr/pic.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_XLR_PIC_H3636-#define _ASM_NLM_XLR_PIC_H3737-3838-#define PIC_CLK_HZ 666666663939-#define pic_timer_freq() PIC_CLK_HZ4040-4141-/* PIC hardware interrupt numbers */4242-#define PIC_IRT_WD_INDEX 04343-#define PIC_IRT_TIMER_0_INDEX 14444-#define PIC_IRT_TIMER_INDEX(i) ((i) + PIC_IRT_TIMER_0_INDEX)4545-#define PIC_IRT_TIMER_1_INDEX 24646-#define PIC_IRT_TIMER_2_INDEX 34747-#define PIC_IRT_TIMER_3_INDEX 44848-#define PIC_IRT_TIMER_4_INDEX 54949-#define PIC_IRT_TIMER_5_INDEX 65050-#define PIC_IRT_TIMER_6_INDEX 75151-#define PIC_IRT_TIMER_7_INDEX 85252-#define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX5353-#define PIC_IRT_UART_0_INDEX 95454-#define PIC_IRT_UART_1_INDEX 105555-#define PIC_IRT_I2C_0_INDEX 115656-#define PIC_IRT_I2C_1_INDEX 125757-#define PIC_IRT_PCMCIA_INDEX 135858-#define PIC_IRT_GPIO_INDEX 145959-#define PIC_IRT_HYPER_INDEX 156060-#define PIC_IRT_PCIX_INDEX 166161-/* XLS */6262-#define PIC_IRT_CDE_INDEX 156363-#define PIC_IRT_BRIDGE_TB_XLS_INDEX 166464-/* XLS */6565-#define PIC_IRT_GMAC0_INDEX 176666-#define PIC_IRT_GMAC1_INDEX 186767-#define PIC_IRT_GMAC2_INDEX 196868-#define PIC_IRT_GMAC3_INDEX 206969-#define PIC_IRT_XGS0_INDEX 217070-#define PIC_IRT_XGS1_INDEX 227171-#define PIC_IRT_HYPER_FATAL_INDEX 237272-#define PIC_IRT_PCIX_FATAL_INDEX 247373-#define PIC_IRT_BRIDGE_AERR_INDEX 257474-#define PIC_IRT_BRIDGE_BERR_INDEX 267575-#define PIC_IRT_BRIDGE_TB_XLR_INDEX 277676-#define PIC_IRT_BRIDGE_AERR_NMI_INDEX 287777-/* XLS */7878-#define PIC_IRT_GMAC4_INDEX 217979-#define PIC_IRT_GMAC5_INDEX 228080-#define PIC_IRT_GMAC6_INDEX 238181-#define PIC_IRT_GMAC7_INDEX 248282-#define PIC_IRT_BRIDGE_ERR_INDEX 258383-#define PIC_IRT_PCIE_LINK0_INDEX 268484-#define PIC_IRT_PCIE_LINK1_INDEX 278585-#define PIC_IRT_PCIE_LINK2_INDEX 238686-#define PIC_IRT_PCIE_LINK3_INDEX 248787-#define PIC_IRT_PCIE_XLSB0_LINK2_INDEX 288888-#define PIC_IRT_PCIE_XLSB0_LINK3_INDEX 298989-#define PIC_IRT_SRIO_LINK0_INDEX 269090-#define PIC_IRT_SRIO_LINK1_INDEX 279191-#define PIC_IRT_SRIO_LINK2_INDEX 289292-#define PIC_IRT_SRIO_LINK3_INDEX 299393-#define PIC_IRT_PCIE_INT_INDEX 289494-#define PIC_IRT_PCIE_FATAL_INDEX 299595-#define PIC_IRT_GPIO_B_INDEX 309696-#define PIC_IRT_USB_INDEX 319797-/* XLS */9898-#define PIC_NUM_IRTS 329999-100100-101101-#define PIC_CLOCK_TIMER 7102102-103103-/* PIC Registers */104104-#define PIC_CTRL 0x00105105-#define PIC_CTRL_STE 8 /* timer enable start bit */106106-#define PIC_IPI 0x04107107-#define PIC_INT_ACK 0x06108108-109109-#define WD_MAX_VAL_0 0x08110110-#define WD_MAX_VAL_1 0x09111111-#define WD_MASK_0 0x0a112112-#define WD_MASK_1 0x0b113113-#define WD_HEARBEAT_0 0x0c114114-#define WD_HEARBEAT_1 0x0d115115-116116-#define PIC_IRT_0_BASE 0x40117117-#define PIC_IRT_1_BASE 0x80118118-#define PIC_TIMER_MAXVAL_0_BASE 0x100119119-#define PIC_TIMER_MAXVAL_1_BASE 0x110120120-#define PIC_TIMER_COUNT_0_BASE 0x120121121-#define PIC_TIMER_COUNT_1_BASE 0x130122122-123123-#define PIC_IRT_0(picintr) (PIC_IRT_0_BASE + (picintr))124124-#define PIC_IRT_1(picintr) (PIC_IRT_1_BASE + (picintr))125125-126126-#define PIC_TIMER_MAXVAL_0(i) (PIC_TIMER_MAXVAL_0_BASE + (i))127127-#define PIC_TIMER_MAXVAL_1(i) (PIC_TIMER_MAXVAL_1_BASE + (i))128128-#define PIC_TIMER_COUNT_0(i) (PIC_TIMER_COUNT_0_BASE + (i))129129-#define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i))130130-131131-/*132132- * Mapping between hardware interrupt numbers and IRQs on CPU133133- * we use a simple scheme to map PIC interrupts 0-31 to IRQs134134- * 8-39. This leaves the IRQ 0-7 for cpu interrupts like135135- * count/compare and FMN136136- */137137-#define PIC_IRQ_BASE 8138138-#define PIC_INTR_TO_IRQ(i) (PIC_IRQ_BASE + (i))139139-#define PIC_IRQ_TO_INTR(i) ((i) - PIC_IRQ_BASE)140140-141141-#define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE142142-#define PIC_WD_IRQ PIC_INTR_TO_IRQ(PIC_IRT_WD_INDEX)143143-#define PIC_TIMER_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_0_INDEX)144144-#define PIC_TIMER_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_1_INDEX)145145-#define PIC_TIMER_2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_2_INDEX)146146-#define PIC_TIMER_3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_3_INDEX)147147-#define PIC_TIMER_4_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_4_INDEX)148148-#define PIC_TIMER_5_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_5_INDEX)149149-#define PIC_TIMER_6_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_6_INDEX)150150-#define PIC_TIMER_7_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_7_INDEX)151151-#define PIC_CLOCK_IRQ (PIC_TIMER_7_IRQ)152152-#define PIC_UART_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_UART_0_INDEX)153153-#define PIC_UART_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_UART_1_INDEX)154154-#define PIC_I2C_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_I2C_0_INDEX)155155-#define PIC_I2C_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_I2C_1_INDEX)156156-#define PIC_PCMCIA_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCMCIA_INDEX)157157-#define PIC_GPIO_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GPIO_INDEX)158158-#define PIC_HYPER_IRQ PIC_INTR_TO_IRQ(PIC_IRT_HYPER_INDEX)159159-#define PIC_PCIX_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIX_INDEX)160160-/* XLS */161161-#define PIC_CDE_IRQ PIC_INTR_TO_IRQ(PIC_IRT_CDE_INDEX)162162-#define PIC_BRIDGE_TB_XLS_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_TB_XLS_INDEX)163163-/* end XLS */164164-#define PIC_GMAC_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC0_INDEX)165165-#define PIC_GMAC_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC1_INDEX)166166-#define PIC_GMAC_2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC2_INDEX)167167-#define PIC_GMAC_3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC3_INDEX)168168-#define PIC_XGS_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_XGS0_INDEX)169169-#define PIC_XGS_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_XGS1_INDEX)170170-#define PIC_HYPER_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_HYPER_FATAL_INDEX)171171-#define PIC_PCIX_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIX_FATAL_INDEX)172172-#define PIC_BRIDGE_AERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_AERR_INDEX)173173-#define PIC_BRIDGE_BERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_BERR_INDEX)174174-#define PIC_BRIDGE_TB_XLR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_TB_XLR_INDEX)175175-#define PIC_BRIDGE_AERR_NMI_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_AERR_NMI_INDEX)176176-/* XLS defines */177177-#define PIC_GMAC_4_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC4_INDEX)178178-#define PIC_GMAC_5_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC5_INDEX)179179-#define PIC_GMAC_6_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC6_INDEX)180180-#define PIC_GMAC_7_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC7_INDEX)181181-#define PIC_BRIDGE_ERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_ERR_INDEX)182182-#define PIC_PCIE_LINK0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK0_INDEX)183183-#define PIC_PCIE_LINK1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK1_INDEX)184184-#define PIC_PCIE_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK2_INDEX)185185-#define PIC_PCIE_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK3_INDEX)186186-#define PIC_PCIE_XLSB0_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_XLSB0_LINK2_INDEX)187187-#define PIC_PCIE_XLSB0_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_XLSB0_LINK3_INDEX)188188-#define PIC_SRIO_LINK0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK0_INDEX)189189-#define PIC_SRIO_LINK1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK1_INDEX)190190-#define PIC_SRIO_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK2_INDEX)191191-#define PIC_SRIO_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK3_INDEX)192192-#define PIC_PCIE_INT_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_INT__INDEX)193193-#define PIC_PCIE_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_FATAL_INDEX)194194-#define PIC_GPIO_B_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GPIO_B_INDEX)195195-#define PIC_USB_IRQ PIC_INTR_TO_IRQ(PIC_IRT_USB_INDEX)196196-#define PIC_IRT_LAST_IRQ PIC_USB_IRQ197197-/* end XLS */198198-199199-#ifndef __ASSEMBLY__200200-201201-#define PIC_IRQ_IS_EDGE_TRIGGERED(irq) (((irq) >= PIC_TIMER_0_IRQ) && \202202- ((irq) <= PIC_TIMER_7_IRQ))203203-#define PIC_IRQ_IS_IRT(irq) (((irq) >= PIC_IRT_FIRST_IRQ) && \204204- ((irq) <= PIC_IRT_LAST_IRQ))205205-206206-static inline int207207-nlm_irq_to_irt(int irq)208208-{209209- if (PIC_IRQ_IS_IRT(irq) == 0)210210- return -1;211211-212212- return PIC_IRQ_TO_INTR(irq);213213-}214214-215215-static inline int216216-nlm_irt_to_irq(int irt)217217-{218218-219219- return PIC_INTR_TO_IRQ(irt);220220-}221221-222222-static inline void223223-nlm_pic_enable_irt(uint64_t base, int irt)224224-{225225- uint32_t reg;226226-227227- reg = nlm_read_reg(base, PIC_IRT_1(irt));228228- nlm_write_reg(base, PIC_IRT_1(irt), reg | (1u << 31));229229-}230230-231231-static inline void232232-nlm_pic_disable_irt(uint64_t base, int irt)233233-{234234- uint32_t reg;235235-236236- reg = nlm_read_reg(base, PIC_IRT_1(irt));237237- nlm_write_reg(base, PIC_IRT_1(irt), reg & ~(1u << 31));238238-}239239-240240-static inline void241241-nlm_pic_send_ipi(uint64_t base, int hwt, int irq, int nmi)242242-{243243- unsigned int tid, pid;244244-245245- tid = hwt & 0x3;246246- pid = (hwt >> 2) & 0x07;247247- nlm_write_reg(base, PIC_IPI,248248- (pid << 20) | (tid << 16) | (nmi << 8) | irq);249249-}250250-251251-static inline void252252-nlm_pic_ack(uint64_t base, int irt)253253-{254254- nlm_write_reg(base, PIC_INT_ACK, 1u << irt);255255-}256256-257257-static inline void258258-nlm_pic_init_irt(uint64_t base, int irt, int irq, int hwt, int en)259259-{260260- nlm_write_reg(base, PIC_IRT_0(irt), (1u << hwt));261261- /* local scheduling, invalid, level by default */262262- nlm_write_reg(base, PIC_IRT_1(irt),263263- (en << 30) | (1 << 6) | irq);264264-}265265-266266-static inline uint64_t267267-nlm_pic_read_timer(uint64_t base, int timer)268268-{269269- uint32_t up1, up2, low;270270-271271- up1 = nlm_read_reg(base, PIC_TIMER_COUNT_1(timer));272272- low = nlm_read_reg(base, PIC_TIMER_COUNT_0(timer));273273- up2 = nlm_read_reg(base, PIC_TIMER_COUNT_1(timer));274274-275275- if (up1 != up2) /* wrapped, get the new low */276276- low = nlm_read_reg(base, PIC_TIMER_COUNT_0(timer));277277- return ((uint64_t)up2 << 32) | low;278278-279279-}280280-281281-static inline uint32_t282282-nlm_pic_read_timer32(uint64_t base, int timer)283283-{284284- return nlm_read_reg(base, PIC_TIMER_COUNT_0(timer));285285-}286286-287287-static inline void288288-nlm_pic_set_timer(uint64_t base, int timer, uint64_t value, int irq, int cpu)289289-{290290- uint32_t up, low;291291- uint64_t pic_ctrl = nlm_read_reg(base, PIC_CTRL);292292- int en;293293-294294- en = (irq > 0);295295- up = value >> 32;296296- low = value & 0xFFFFFFFF;297297- nlm_write_reg(base, PIC_TIMER_MAXVAL_0(timer), low);298298- nlm_write_reg(base, PIC_TIMER_MAXVAL_1(timer), up);299299- nlm_pic_init_irt(base, PIC_IRT_TIMER_INDEX(timer), irq, cpu, 0);300300-301301- /* enable the timer */302302- pic_ctrl |= (1 << (PIC_CTRL_STE + timer));303303- nlm_write_reg(base, PIC_CTRL, pic_ctrl);304304-}305305-#endif306306-#endif /* _ASM_NLM_XLR_PIC_H */
-59
arch/mips/include/asm/netlogic/xlr/xlr.h
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#ifndef _ASM_NLM_XLR_H3636-#define _ASM_NLM_XLR_H3737-3838-/* SMP helpers */3939-void xlr_wakeup_secondary_cpus(void);4040-4141-/* XLS B silicon "Rook" */4242-static inline unsigned int nlm_chip_is_xls_b(void)4343-{4444- uint32_t prid = read_c0_prid();4545-4646- return ((prid & 0xf000) == 0x4000);4747-}4848-4949-/* XLR chip types */5050-/* The XLS product line has chip versions 0x[48c]? */5151-static inline unsigned int nlm_chip_is_xls(void)5252-{5353- uint32_t prid = read_c0_prid();5454-5555- return ((prid & 0xf000) == 0x8000 || (prid & 0xf000) == 0x4000 ||5656- (prid & 0xf000) == 0xc000);5757-}5858-5959-#endif /* _ASM_NLM_XLR_H */
···5454#define MODULE_PROC_FAMILY "OCTEON "5555#elif defined CONFIG_CPU_P56005656#define MODULE_PROC_FAMILY "P5600 "5757-#elif defined CONFIG_CPU_XLR5858-#define MODULE_PROC_FAMILY "XLR "5959-#elif defined CONFIG_CPU_XLP6060-#define MODULE_PROC_FAMILY "XLP "6157#else6258#error MODULE_PROC_FAMILY undefined for your processor configuration6359#endif
-84
arch/mips/kernel/cpu-probe.c
···18861886 }18871887}1888188818891889-static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)18901890-{18911891- decode_configs(c);18921892-18931893- if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) {18941894- c->cputype = CPU_ALCHEMY;18951895- __cpu_name[cpu] = "Au1300";18961896- /* following stuff is not for Alchemy */18971897- return;18981898- }18991899-19001900- c->options = (MIPS_CPU_TLB |19011901- MIPS_CPU_4KEX |19021902- MIPS_CPU_COUNTER |19031903- MIPS_CPU_DIVEC |19041904- MIPS_CPU_WATCH |19051905- MIPS_CPU_EJTAG |19061906- MIPS_CPU_LLSC);19071907-19081908- switch (c->processor_id & PRID_IMP_MASK) {19091909- case PRID_IMP_NETLOGIC_XLP2XX:19101910- case PRID_IMP_NETLOGIC_XLP9XX:19111911- case PRID_IMP_NETLOGIC_XLP5XX:19121912- c->cputype = CPU_XLP;19131913- __cpu_name[cpu] = "Broadcom XLPII";19141914- break;19151915-19161916- case PRID_IMP_NETLOGIC_XLP8XX:19171917- case PRID_IMP_NETLOGIC_XLP3XX:19181918- c->cputype = CPU_XLP;19191919- __cpu_name[cpu] = "Netlogic XLP";19201920- break;19211921-19221922- case PRID_IMP_NETLOGIC_XLR732:19231923- case PRID_IMP_NETLOGIC_XLR716:19241924- case PRID_IMP_NETLOGIC_XLR532:19251925- case PRID_IMP_NETLOGIC_XLR308:19261926- case PRID_IMP_NETLOGIC_XLR532C:19271927- case PRID_IMP_NETLOGIC_XLR516C:19281928- case PRID_IMP_NETLOGIC_XLR508C:19291929- case PRID_IMP_NETLOGIC_XLR308C:19301930- c->cputype = CPU_XLR;19311931- __cpu_name[cpu] = "Netlogic XLR";19321932- break;19331933-19341934- case PRID_IMP_NETLOGIC_XLS608:19351935- case PRID_IMP_NETLOGIC_XLS408:19361936- case PRID_IMP_NETLOGIC_XLS404:19371937- case PRID_IMP_NETLOGIC_XLS208:19381938- case PRID_IMP_NETLOGIC_XLS204:19391939- case PRID_IMP_NETLOGIC_XLS108:19401940- case PRID_IMP_NETLOGIC_XLS104:19411941- case PRID_IMP_NETLOGIC_XLS616B:19421942- case PRID_IMP_NETLOGIC_XLS608B:19431943- case PRID_IMP_NETLOGIC_XLS416B:19441944- case PRID_IMP_NETLOGIC_XLS412B:19451945- case PRID_IMP_NETLOGIC_XLS408B:19461946- case PRID_IMP_NETLOGIC_XLS404B:19471947- c->cputype = CPU_XLR;19481948- __cpu_name[cpu] = "Netlogic XLS";19491949- break;19501950-19511951- default:19521952- pr_info("Unknown Netlogic chip id [%02x]!\n",19531953- c->processor_id);19541954- c->cputype = CPU_XLR;19551955- break;19561956- }19571957-19581958- if (c->cputype == CPU_XLP) {19591959- set_isa(c, MIPS_CPU_ISA_M64R2);19601960- c->options |= (MIPS_CPU_FPU | MIPS_CPU_ULRI | MIPS_CPU_MCHECK);19611961- /* This will be updated again after all threads are woken up */19621962- c->tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1;19631963- } else {19641964- set_isa(c, MIPS_CPU_ISA_M64R1);19651965- c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1;19661966- }19671967- c->kscratch_mask = 0xf;19681968-}19691969-19701889#ifdef CONFIG_64BIT19711890/* For use by uaccess.h */19721891u64 __ua_limit;···19492030 case PRID_COMP_INGENIC_D1:19502031 case PRID_COMP_INGENIC_E1:19512032 cpu_probe_ingenic(c, cpu);19521952- break;19531953- case PRID_COMP_NETLOGIC:19541954- cpu_probe_netlogic(c, cpu);19552033 break;19562034 }19572035
-2
arch/mips/kernel/idle.c
···175175 case CPU_CAVIUM_OCTEON3:176176 case CPU_XBURST:177177 case CPU_LOONGSON32:178178- case CPU_XLR:179179- case CPU_XLP:180178 cpu_wait = r4k_wait;181179 break;182180 case CPU_LOONGSON64:
···325325326326static inline int __maybe_unused c0_kscratch(void)327327{328328- switch (current_cpu_type()) {329329- case CPU_XLP:330330- case CPU_XLR:331331- return 22;332332- default:333333- return 31;334334- }328328+ return 31;335329}336330337331static int allocate_kscratch(void)···547553 case CPU_5KC:548554 case CPU_TX49XX:549555 case CPU_PR4450:550550- case CPU_XLR:551556 uasm_i_nop(p);552557 tlbw(p);553558 break;
-86
arch/mips/netlogic/Kconfig
···11-# SPDX-License-Identifier: GPL-2.022-if NLM_XLP_BOARD || NLM_XLR_BOARD33-44-if NLM_XLP_BOARD55-config DT_XLP_EVP66- bool "Built-in device tree for XLP EVP boards"77- default y88- select BUILTIN_DTB99- help1010- Add an FDT blob for XLP EVP boards into the kernel.1111- This DTB will be used if the firmware does not pass in a DTB1212- pointer to the kernel. The corresponding DTS file is at1313- arch/mips/netlogic/dts/xlp_evp.dts1414-1515-config DT_XLP_SVP1616- bool "Built-in device tree for XLP SVP boards"1717- default y1818- select BUILTIN_DTB1919- help2020- Add an FDT blob for XLP VP boards into the kernel.2121- This DTB will be used if the firmware does not pass in a DTB2222- pointer to the kernel. The corresponding DTS file is at2323- arch/mips/netlogic/dts/xlp_svp.dts2424-2525-config DT_XLP_FVP2626- bool "Built-in device tree for XLP FVP boards"2727- default y2828- select BUILTIN_DTB2929- help3030- Add an FDT blob for XLP FVP board into the kernel.3131- This DTB will be used if the firmware does not pass in a DTB3232- pointer to the kernel. The corresponding DTS file is at3333- arch/mips/netlogic/dts/xlp_fvp.dts3434-3535-config DT_XLP_GVP3636- bool "Built-in device tree for XLP GVP boards"3737- default y3838- select BUILTIN_DTB3939- help4040- Add an FDT blob for XLP GVP board into the kernel.4141- This DTB will be used if the firmware does not pass in a DTB4242- pointer to the kernel. The corresponding DTS file is at4343- arch/mips/netlogic/dts/xlp_gvp.dts4444-4545-config DT_XLP_RVP4646- bool "Built-in device tree for XLP RVP boards"4747- default y4848- help4949- Add an FDT blob for XLP RVP board into the kernel.5050- This DTB will be used if the firmware does not pass in a DTB5151- pointer to the kernel. The corresponding DTS file is at5252- arch/mips/netlogic/dts/xlp_rvp.dts5353-5454-config NLM_MULTINODE5555- bool "Support for multi-chip boards"5656- depends on NLM_XLP_BOARD5757- default n5858- help5959- Add support for boards with 2 or 4 XLPs connected over ICI.6060-6161-if NLM_MULTINODE6262-choice6363- prompt "Number of XLPs on the board"6464- default NLM_MULTINODE_26565- help6666- In the multi-node case, specify the number of SoCs on the board.6767-6868-config NLM_MULTINODE_26969- bool "Dual-XLP board"7070- help7171- Support boards with upto two XLPs connected over ICI.7272-7373-config NLM_MULTINODE_47474- bool "Quad-XLP board"7575- help7676- Support boards with upto four XLPs connected over ICI.7777-7878-endchoice7979-8080-endif8181-endif8282-8383-config NLM_COMMON8484- bool8585-8686-endif
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/types.h>3636-#include <linux/serial_reg.h>3737-3838-#include <asm/mipsregs.h>3939-#include <asm/setup.h>4040-#include <asm/netlogic/haldefs.h>4141-#include <asm/netlogic/common.h>4242-4343-#if defined(CONFIG_CPU_XLP)4444-#include <asm/netlogic/xlp-hal/iomap.h>4545-#include <asm/netlogic/xlp-hal/xlp.h>4646-#include <asm/netlogic/xlp-hal/uart.h>4747-#elif defined(CONFIG_CPU_XLR)4848-#include <asm/netlogic/xlr/iomap.h>4949-#endif5050-5151-void prom_putchar(char c)5252-{5353- uint64_t uartbase;5454-5555-#if defined(CONFIG_CPU_XLP)5656- uartbase = nlm_get_uart_regbase(0, 0);5757-#elif defined(CONFIG_CPU_XLR)5858- uartbase = nlm_mmio_base(NETLOGIC_IO_UART_0_OFFSET);5959-#endif6060- while ((nlm_read_reg(uartbase, UART_LSR) & UART_LSR_THRE) == 0)6161- ;6262- nlm_write_reg(uartbase, UART_TX, c);6363-}
-350
arch/mips/netlogic/common/irq.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/init.h>3737-#include <linux/linkage.h>3838-#include <linux/interrupt.h>3939-#include <linux/mm.h>4040-#include <linux/slab.h>4141-#include <linux/irq.h>4242-4343-#include <linux/irqdomain.h>4444-#include <linux/of_address.h>4545-#include <linux/of_irq.h>4646-4747-#include <asm/errno.h>4848-#include <asm/signal.h>4949-#include <asm/ptrace.h>5050-#include <asm/mipsregs.h>5151-#include <asm/thread_info.h>5252-5353-#include <asm/netlogic/mips-extns.h>5454-#include <asm/netlogic/interrupt.h>5555-#include <asm/netlogic/haldefs.h>5656-#include <asm/netlogic/common.h>5757-5858-#if defined(CONFIG_CPU_XLP)5959-#include <asm/netlogic/xlp-hal/iomap.h>6060-#include <asm/netlogic/xlp-hal/xlp.h>6161-#include <asm/netlogic/xlp-hal/pic.h>6262-#elif defined(CONFIG_CPU_XLR)6363-#include <asm/netlogic/xlr/iomap.h>6464-#include <asm/netlogic/xlr/pic.h>6565-#include <asm/netlogic/xlr/fmn.h>6666-#else6767-#error "Unknown CPU"6868-#endif6969-7070-#ifdef CONFIG_SMP7171-#define SMP_IRQ_MASK ((1ULL << IRQ_IPI_SMP_FUNCTION) | \7272- (1ULL << IRQ_IPI_SMP_RESCHEDULE))7373-#else7474-#define SMP_IRQ_MASK 07575-#endif7676-#define PERCPU_IRQ_MASK (SMP_IRQ_MASK | (1ull << IRQ_TIMER) | \7777- (1ull << IRQ_FMN))7878-7979-struct nlm_pic_irq {8080- void (*extra_ack)(struct irq_data *);8181- struct nlm_soc_info *node;8282- int picirq;8383- int irt;8484- int flags;8585-};8686-8787-static void xlp_pic_enable(struct irq_data *d)8888-{8989- unsigned long flags;9090- struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d);9191-9292- BUG_ON(!pd);9393- spin_lock_irqsave(&pd->node->piclock, flags);9494- nlm_pic_enable_irt(pd->node->picbase, pd->irt);9595- spin_unlock_irqrestore(&pd->node->piclock, flags);9696-}9797-9898-static void xlp_pic_disable(struct irq_data *d)9999-{100100- struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d);101101- unsigned long flags;102102-103103- BUG_ON(!pd);104104- spin_lock_irqsave(&pd->node->piclock, flags);105105- nlm_pic_disable_irt(pd->node->picbase, pd->irt);106106- spin_unlock_irqrestore(&pd->node->piclock, flags);107107-}108108-109109-static void xlp_pic_mask_ack(struct irq_data *d)110110-{111111- struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d);112112-113113- clear_c0_eimr(pd->picirq);114114- ack_c0_eirr(pd->picirq);115115-}116116-117117-static void xlp_pic_unmask(struct irq_data *d)118118-{119119- struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d);120120-121121- BUG_ON(!pd);122122-123123- if (pd->extra_ack)124124- pd->extra_ack(d);125125-126126- /* re-enable the intr on this cpu */127127- set_c0_eimr(pd->picirq);128128-129129- /* Ack is a single write, no need to lock */130130- nlm_pic_ack(pd->node->picbase, pd->irt);131131-}132132-133133-static struct irq_chip xlp_pic = {134134- .name = "XLP-PIC",135135- .irq_enable = xlp_pic_enable,136136- .irq_disable = xlp_pic_disable,137137- .irq_mask_ack = xlp_pic_mask_ack,138138- .irq_unmask = xlp_pic_unmask,139139-};140140-141141-static void cpuintr_disable(struct irq_data *d)142142-{143143- clear_c0_eimr(d->irq);144144-}145145-146146-static void cpuintr_enable(struct irq_data *d)147147-{148148- set_c0_eimr(d->irq);149149-}150150-151151-static void cpuintr_ack(struct irq_data *d)152152-{153153- ack_c0_eirr(d->irq);154154-}155155-156156-/*157157- * Chip definition for CPU originated interrupts(timer, msg) and158158- * IPIs159159- */160160-struct irq_chip nlm_cpu_intr = {161161- .name = "XLP-CPU-INTR",162162- .irq_enable = cpuintr_enable,163163- .irq_disable = cpuintr_disable,164164- .irq_mask = cpuintr_disable,165165- .irq_ack = cpuintr_ack,166166- .irq_eoi = cpuintr_enable,167167-};168168-169169-static void __init nlm_init_percpu_irqs(void)170170-{171171- int i;172172-173173- for (i = 0; i < PIC_IRT_FIRST_IRQ; i++)174174- irq_set_chip_and_handler(i, &nlm_cpu_intr, handle_percpu_irq);175175-#ifdef CONFIG_SMP176176- irq_set_chip_and_handler(IRQ_IPI_SMP_FUNCTION, &nlm_cpu_intr,177177- nlm_smp_function_ipi_handler);178178- irq_set_chip_and_handler(IRQ_IPI_SMP_RESCHEDULE, &nlm_cpu_intr,179179- nlm_smp_resched_ipi_handler);180180-#endif181181-}182182-183183-184184-void nlm_setup_pic_irq(int node, int picirq, int irq, int irt)185185-{186186- struct nlm_pic_irq *pic_data;187187- int xirq;188188-189189- xirq = nlm_irq_to_xirq(node, irq);190190- pic_data = kzalloc(sizeof(*pic_data), GFP_KERNEL);191191- BUG_ON(pic_data == NULL);192192- pic_data->irt = irt;193193- pic_data->picirq = picirq;194194- pic_data->node = nlm_get_node(node);195195- irq_set_chip_and_handler(xirq, &xlp_pic, handle_level_irq);196196- irq_set_chip_data(xirq, pic_data);197197-}198198-199199-void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *))200200-{201201- struct nlm_pic_irq *pic_data;202202- int xirq;203203-204204- xirq = nlm_irq_to_xirq(node, irq);205205- pic_data = irq_get_chip_data(xirq);206206- if (WARN_ON(!pic_data))207207- return;208208- pic_data->extra_ack = xack;209209-}210210-211211-static void nlm_init_node_irqs(int node)212212-{213213- struct nlm_soc_info *nodep;214214- int i, irt;215215-216216- pr_info("Init IRQ for node %d\n", node);217217- nodep = nlm_get_node(node);218218- nodep->irqmask = PERCPU_IRQ_MASK;219219- for (i = PIC_IRT_FIRST_IRQ; i <= PIC_IRT_LAST_IRQ; i++) {220220- irt = nlm_irq_to_irt(i);221221- if (irt == -1) /* unused irq */222222- continue;223223- nodep->irqmask |= 1ull << i;224224- if (irt == -2) /* not a direct PIC irq */225225- continue;226226-227227- nlm_pic_init_irt(nodep->picbase, irt, i,228228- node * nlm_threads_per_node(), 0);229229- nlm_setup_pic_irq(node, i, i, irt);230230- }231231-}232232-233233-void nlm_smp_irq_init(int hwtid)234234-{235235- int cpu, node;236236-237237- cpu = hwtid % nlm_threads_per_node();238238- node = hwtid / nlm_threads_per_node();239239-240240- if (cpu == 0 && node != 0)241241- nlm_init_node_irqs(node);242242- write_c0_eimr(nlm_get_node(node)->irqmask);243243-}244244-245245-asmlinkage void plat_irq_dispatch(void)246246-{247247- uint64_t eirr;248248- int i, node;249249-250250- node = nlm_nodeid();251251- eirr = read_c0_eirr_and_eimr();252252- if (eirr == 0)253253- return;254254-255255- i = __ffs64(eirr);256256- /* per-CPU IRQs don't need translation */257257- if (i < PIC_IRQ_BASE) {258258- do_IRQ(i);259259- return;260260- }261261-262262-#if defined(CONFIG_PCI_MSI) && defined(CONFIG_CPU_XLP)263263- /* PCI interrupts need a second level dispatch for MSI bits */264264- if (i >= PIC_PCIE_LINK_MSI_IRQ(0) && i <= PIC_PCIE_LINK_MSI_IRQ(3)) {265265- nlm_dispatch_msi(node, i);266266- return;267267- }268268- if (i >= PIC_PCIE_MSIX_IRQ(0) && i <= PIC_PCIE_MSIX_IRQ(3)) {269269- nlm_dispatch_msix(node, i);270270- return;271271- }272272-273273-#endif274274- /* top level irq handling */275275- do_IRQ(nlm_irq_to_xirq(node, i));276276-}277277-278278-#ifdef CONFIG_CPU_XLP279279-static int __init xlp_of_pic_init(struct device_node *node,280280- struct device_node *parent)281281-{282282- const int n_picirqs = PIC_IRT_LAST_IRQ - PIC_IRQ_BASE + 1;283283- struct irq_domain *xlp_pic_domain;284284- struct resource res;285285- int socid, ret, bus;286286-287287- /* we need a hack to get the PIC's SoC chip id */288288- ret = of_address_to_resource(node, 0, &res);289289- if (ret < 0) {290290- pr_err("PIC %pOFn: reg property not found!\n", node);291291- return -EINVAL;292292- }293293-294294- if (cpu_is_xlp9xx()) {295295- bus = (res.start >> 20) & 0xf;296296- for (socid = 0; socid < NLM_NR_NODES; socid++) {297297- if (!nlm_node_present(socid))298298- continue;299299- if (nlm_get_node(socid)->socbus == bus)300300- break;301301- }302302- if (socid == NLM_NR_NODES) {303303- pr_err("PIC %pOFn: Node mapping for bus %d not found!\n",304304- node, bus);305305- return -EINVAL;306306- }307307- } else {308308- socid = (res.start >> 18) & 0x3;309309- if (!nlm_node_present(socid)) {310310- pr_err("PIC %pOFn: node %d does not exist!\n",311311- node, socid);312312- return -EINVAL;313313- }314314- }315315-316316- if (!nlm_node_present(socid)) {317317- pr_err("PIC %pOFn: node %d does not exist!\n", node, socid);318318- return -EINVAL;319319- }320320-321321- xlp_pic_domain = irq_domain_add_legacy(node, n_picirqs,322322- nlm_irq_to_xirq(socid, PIC_IRQ_BASE), PIC_IRQ_BASE,323323- &irq_domain_simple_ops, NULL);324324- if (xlp_pic_domain == NULL) {325325- pr_err("PIC %pOFn: Creating legacy domain failed!\n", node);326326- return -EINVAL;327327- }328328- pr_info("Node %d: IRQ domain created for PIC@%pR\n", socid, &res);329329- return 0;330330-}331331-332332-static struct of_device_id __initdata xlp_pic_irq_ids[] = {333333- { .compatible = "netlogic,xlp-pic", .data = xlp_of_pic_init },334334- {},335335-};336336-#endif337337-338338-void __init arch_init_irq(void)339339-{340340- /* Initialize the irq descriptors */341341- nlm_init_percpu_irqs();342342- nlm_init_node_irqs(0);343343- write_c0_eimr(nlm_current_node()->irqmask);344344-#if defined(CONFIG_CPU_XLR)345345- nlm_setup_fmn_irq();346346-#endif347347-#ifdef CONFIG_CPU_XLP348348- of_irq_init(xlp_pic_irq_ids);349349-#endif350350-}
-299
arch/mips/netlogic/common/reset.S
···11-/*22- * Copyright 2003-2013 Broadcom Corporation.33- * All Rights Reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-3636-#include <asm/asm.h>3737-#include <asm/asm-offsets.h>3838-#include <asm/cpu.h>3939-#include <asm/cacheops.h>4040-#include <asm/regdef.h>4141-#include <asm/mipsregs.h>4242-#include <asm/stackframe.h>4343-#include <asm/asmmacro.h>4444-#include <asm/addrspace.h>4545-4646-#include <asm/netlogic/common.h>4747-4848-#include <asm/netlogic/xlp-hal/iomap.h>4949-#include <asm/netlogic/xlp-hal/xlp.h>5050-#include <asm/netlogic/xlp-hal/sys.h>5151-#include <asm/netlogic/xlp-hal/cpucontrol.h>5252-5353-#define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \5454- XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \5555- SYS_CPU_NONCOHERENT_MODE * 45656-5757-/* Enable XLP features and workarounds in the LSU */5858-.macro xlp_config_lsu5959- li t0, LSU_DEFEATURE6060- mfcr t1, t06161-6262- lui t2, 0x4080 /* Enable Unaligned Access, L2HPE */6363- or t1, t1, t26464- mtcr t1, t06565-6666- li t0, ICU_DEFEATURE6767- mfcr t1, t06868- ori t1, 0x1000 /* Enable Icache partitioning */6969- mtcr t1, t07070-7171- li t0, SCHED_DEFEATURE7272- lui t1, 0x0100 /* Disable BRU accepting ALU ops */7373- mtcr t1, t07474-.endm7575-7676-/*7777- * Allow access to physical mem >64G by enabling ELPA in PAGEGRAIN7878- * register. This is needed before going to C code since the SP can7979- * in this region. Called from all HW threads.8080- */8181-.macro xlp_early_mmu_init8282- mfc0 t0, CP0_PAGEMASK, 18383- li t1, (1 << 29) /* ELPA bit */8484- or t0, t18585- mtc0 t0, CP0_PAGEMASK, 18686-.endm8787-8888-/*8989- * L1D cache has to be flushed before enabling threads in XLP.9090- * On XLP8xx/XLP3xx, we do a low level flush using processor control9191- * registers. On XLPII CPUs, usual cache instructions work.9292- */9393-.macro xlp_flush_l1_dcache9494- mfc0 t0, CP0_PRID9595- andi t0, t0, PRID_IMP_MASK9696- slt t1, t0, 0x12009797- beqz t1, 15f9898- nop9999-100100- /* XLP8xx low level cache flush */101101- li t0, LSU_DEBUG_DATA0102102- li t1, LSU_DEBUG_ADDR103103- li t2, 0 /* index */104104- li t3, 0x1000 /* loop count */105105-11:106106- sll v0, t2, 5107107- mtcr zero, t0108108- ori v1, v0, 0x3 /* way0 | write_enable | write_active */109109- mtcr v1, t1110110-12:111111- mfcr v1, t1112112- andi v1, 0x1 /* wait for write_active == 0 */113113- bnez v1, 12b114114- nop115115- mtcr zero, t0116116- ori v1, v0, 0x7 /* way1 | write_enable | write_active */117117- mtcr v1, t1118118-13:119119- mfcr v1, t1120120- andi v1, 0x1 /* wait for write_active == 0 */121121- bnez v1, 13b122122- nop123123- addi t2, 1124124- bne t3, t2, 11b125125- nop126126- b 17f127127- nop128128-129129- /* XLPII CPUs, Invalidate all 64k of L1 D-cache */130130-15:131131- li t0, 0x80000000132132- li t1, 0x80010000133133-16: cache Index_Writeback_Inv_D, 0(t0)134134- addiu t0, t0, 32135135- bne t0, t1, 16b136136- nop137137-17:138138-.endm139139-140140-/*141141- * nlm_reset_entry will be copied to the reset entry point for142142- * XLR and XLP. The XLP cores start here when they are woken up. This143143- * is also the NMI entry point.144144- *145145- * We use scratch reg 6/7 to save k0/k1 and check for NMI first.146146- *147147- * The data corresponding to reset/NMI is stored at RESET_DATA_PHYS148148- * location, this will have the thread mask (used when core is woken up)149149- * and the current NMI handler in case we reached here for an NMI.150150- *151151- * When a core or thread is newly woken up, it marks itself ready and152152- * loops in a 'wait'. When the CPU really needs waking up, we send an NMI153153- * IPI to it, with the NMI handler set to prom_boot_secondary_cpus154154- */155155- .set noreorder156156- .set noat157157- .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */158158-159159-FEXPORT(nlm_reset_entry)160160- dmtc0 k0, $22, 6161161- dmtc0 k1, $22, 7162162- mfc0 k0, CP0_STATUS163163- li k1, 0x80000164164- and k1, k0, k1165165- beqz k1, 1f /* go to real reset entry */166166- nop167167- li k1, CKSEG1ADDR(RESET_DATA_PHYS) /* NMI */168168- ld k0, BOOT_NMI_HANDLER(k1)169169- jr k0170170- nop171171-172172-1: /* Entry point on core wakeup */173173- mfc0 t0, CP0_PRID /* processor ID */174174- andi t0, PRID_IMP_MASK175175- li t1, 0x1500 /* XLP 9xx */176176- beq t0, t1, 2f /* does not need to set coherent */177177- nop178178-179179- li t1, 0x1300 /* XLP 5xx */180180- beq t0, t1, 2f /* does not need to set coherent */181181- nop182182-183183- /* set bit in SYS coherent register for the core */184184- mfc0 t0, CP0_EBASE185185- mfc0 t1, CP0_EBASE186186- srl t1, 5187187- andi t1, 0x3 /* t1 <- node */188188- li t2, 0x40000189189- mul t3, t2, t1 /* t3 = node * 0x40000 */190190- srl t0, t0, 2191191- and t0, t0, 0x7 /* t0 <- core */192192- li t1, 0x1193193- sll t0, t1, t0194194- nor t0, t0, zero /* t0 <- ~(1 << core) */195195- li t2, SYS_CPU_COHERENT_BASE196196- add t2, t2, t3 /* t2 <- SYS offset for node */197197- lw t1, 0(t2)198198- and t1, t1, t0199199- sw t1, 0(t2)200200-201201- /* read back to ensure complete */202202- lw t1, 0(t2)203203- sync204204-205205-2:206206- /* Configure LSU on Non-0 Cores. */207207- xlp_config_lsu208208- /* FALL THROUGH */209209-210210-/*211211- * Wake up sibling threads from the initial thread in a core.212212- */213213-EXPORT(nlm_boot_siblings)214214- /* core L1D flush before enable threads */215215- xlp_flush_l1_dcache216216- /* save ra and sp, will be used later (only for boot cpu) */217217- dmtc0 ra, $22, 6218218- dmtc0 sp, $22, 7219219- /* Enable hw threads by writing to MAP_THREADMODE of the core */220220- li t0, CKSEG1ADDR(RESET_DATA_PHYS)221221- lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */222222- li t0, ((CPU_BLOCKID_MAP << 8) | MAP_THREADMODE)223223- mfcr t2, t0224224- or t2, t2, t1225225- mtcr t2, t0226226-227227- /*228228- * The new hardware thread starts at the next instruction229229- * For all the cases other than core 0 thread 0, we will230230- * jump to the secondary wait function.231231-232232- * NOTE: All GPR contents are lost after the mtcr above!233233- */234234- mfc0 v0, CP0_EBASE235235- andi v0, 0x3ff /* v0 <- node/core */236236-237237- /*238238- * Errata: to avoid potential live lock, setup IFU_BRUB_RESERVE239239- * when running 4 threads per core240240- */241241- andi v1, v0, 0x3 /* v1 <- thread id */242242- bnez v1, 2f243243- nop244244-245245- /* thread 0 of each core. */246246- li t0, CKSEG1ADDR(RESET_DATA_PHYS)247247- lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */248248- subu t1, 0x3 /* 4-thread per core mode? */249249- bnez t1, 2f250250- nop251251-252252- li t0, IFU_BRUB_RESERVE253253- li t1, 0x55254254- mtcr t1, t0255255- _ehb256256-2:257257- beqz v0, 4f /* boot cpu (cpuid == 0)? */258258- nop259259-260260- /* setup status reg */261261- move t1, zero262262-#ifdef CONFIG_64BIT263263- ori t1, ST0_KX264264-#endif265265- mtc0 t1, CP0_STATUS266266-267267- xlp_early_mmu_init268268-269269- /* mark CPU ready */270270- li t3, CKSEG1ADDR(RESET_DATA_PHYS)271271- ADDIU t1, t3, BOOT_CPU_READY272272- sll v1, v0, 2273273- PTR_ADDU t1, v1274274- li t2, 1275275- sw t2, 0(t1)276276- /* Wait until NMI hits */277277-3: wait278278- b 3b279279- nop280280-281281- /*282282- * For the boot CPU, we have to restore ra and sp and return, rest283283- * of the registers will be restored by the caller284284- */285285-4:286286- dmfc0 ra, $22, 6287287- dmfc0 sp, $22, 7288288- jr ra289289- nop290290-EXPORT(nlm_reset_entry_end)291291-292292-LEAF(nlm_init_boot_cpu)293293-#ifdef CONFIG_CPU_XLP294294- xlp_config_lsu295295- xlp_early_mmu_init296296-#endif297297- jr ra298298- nop299299-END(nlm_init_boot_cpu)
-285
arch/mips/netlogic/common/smp.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/delay.h>3737-#include <linux/init.h>3838-#include <linux/sched/task_stack.h>3939-#include <linux/smp.h>4040-#include <linux/irq.h>4141-4242-#include <asm/mmu_context.h>4343-4444-#include <asm/netlogic/interrupt.h>4545-#include <asm/netlogic/mips-extns.h>4646-#include <asm/netlogic/haldefs.h>4747-#include <asm/netlogic/common.h>4848-4949-#if defined(CONFIG_CPU_XLP)5050-#include <asm/netlogic/xlp-hal/iomap.h>5151-#include <asm/netlogic/xlp-hal/xlp.h>5252-#include <asm/netlogic/xlp-hal/pic.h>5353-#elif defined(CONFIG_CPU_XLR)5454-#include <asm/netlogic/xlr/iomap.h>5555-#include <asm/netlogic/xlr/pic.h>5656-#include <asm/netlogic/xlr/xlr.h>5757-#else5858-#error "Unknown CPU"5959-#endif6060-6161-void nlm_send_ipi_single(int logical_cpu, unsigned int action)6262-{6363- unsigned int hwtid;6464- uint64_t picbase;6565-6666- /* node id is part of hwtid, and needed for send_ipi */6767- hwtid = cpu_logical_map(logical_cpu);6868- picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase;6969-7070- if (action & SMP_CALL_FUNCTION)7171- nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_FUNCTION, 0);7272- if (action & SMP_RESCHEDULE_YOURSELF)7373- nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_RESCHEDULE, 0);7474-}7575-7676-void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action)7777-{7878- int cpu;7979-8080- for_each_cpu(cpu, mask) {8181- nlm_send_ipi_single(cpu, action);8282- }8383-}8484-8585-/* IRQ_IPI_SMP_FUNCTION Handler */8686-void nlm_smp_function_ipi_handler(struct irq_desc *desc)8787-{8888- unsigned int irq = irq_desc_get_irq(desc);8989- clear_c0_eimr(irq);9090- ack_c0_eirr(irq);9191- generic_smp_call_function_interrupt();9292- set_c0_eimr(irq);9393-}9494-9595-/* IRQ_IPI_SMP_RESCHEDULE handler */9696-void nlm_smp_resched_ipi_handler(struct irq_desc *desc)9797-{9898- unsigned int irq = irq_desc_get_irq(desc);9999- clear_c0_eimr(irq);100100- ack_c0_eirr(irq);101101- scheduler_ipi();102102- set_c0_eimr(irq);103103-}104104-105105-/*106106- * Called before going into mips code, early cpu init107107- */108108-void nlm_early_init_secondary(int cpu)109109-{110110- change_c0_config(CONF_CM_CMASK, 0x3);111111-#ifdef CONFIG_CPU_XLP112112- xlp_mmu_init();113113-#endif114114- write_c0_ebase(nlm_current_node()->ebase);115115-}116116-117117-/*118118- * Code to run on secondary just after probing the CPU119119- */120120-static void nlm_init_secondary(void)121121-{122122- int hwtid;123123-124124- hwtid = hard_smp_processor_id();125125- cpu_set_core(¤t_cpu_data, hwtid / NLM_THREADS_PER_CORE);126126- current_cpu_data.package = nlm_nodeid();127127- nlm_percpu_init(hwtid);128128- nlm_smp_irq_init(hwtid);129129-}130130-131131-void nlm_prepare_cpus(unsigned int max_cpus)132132-{133133- /* declare we are SMT capable */134134- smp_num_siblings = nlm_threads_per_core;135135-}136136-137137-void nlm_smp_finish(void)138138-{139139- local_irq_enable();140140-}141141-142142-/*143143- * Boot all other cpus in the system, initialize them, and bring them into144144- * the boot function145145- */146146-unsigned long nlm_next_gp;147147-unsigned long nlm_next_sp;148148-static cpumask_t phys_cpu_present_mask;149149-150150-int nlm_boot_secondary(int logical_cpu, struct task_struct *idle)151151-{152152- uint64_t picbase;153153- int hwtid;154154-155155- hwtid = cpu_logical_map(logical_cpu);156156- picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase;157157-158158- nlm_next_sp = (unsigned long)__KSTK_TOS(idle);159159- nlm_next_gp = (unsigned long)task_thread_info(idle);160160-161161- /* barrier for sp/gp store above */162162- __sync();163163- nlm_pic_send_ipi(picbase, hwtid, 1, 1); /* NMI */164164-165165- return 0;166166-}167167-168168-void __init nlm_smp_setup(void)169169-{170170- unsigned int boot_cpu;171171- int num_cpus, i, ncore, node;172172- volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY);173173-174174- boot_cpu = hard_smp_processor_id();175175- cpumask_clear(&phys_cpu_present_mask);176176-177177- cpumask_set_cpu(boot_cpu, &phys_cpu_present_mask);178178- __cpu_number_map[boot_cpu] = 0;179179- __cpu_logical_map[0] = boot_cpu;180180- set_cpu_possible(0, true);181181-182182- num_cpus = 1;183183- for (i = 0; i < NR_CPUS; i++) {184184- /*185185- * cpu_ready array is not set for the boot_cpu,186186- * it is only set for ASPs (see smpboot.S)187187- */188188- if (cpu_ready[i]) {189189- cpumask_set_cpu(i, &phys_cpu_present_mask);190190- __cpu_number_map[i] = num_cpus;191191- __cpu_logical_map[num_cpus] = i;192192- set_cpu_possible(num_cpus, true);193193- node = nlm_hwtid_to_node(i);194194- cpumask_set_cpu(num_cpus, &nlm_get_node(node)->cpumask);195195- ++num_cpus;196196- }197197- }198198-199199- pr_info("Physical CPU mask: %*pb\n",200200- cpumask_pr_args(&phys_cpu_present_mask));201201- pr_info("Possible CPU mask: %*pb\n",202202- cpumask_pr_args(cpu_possible_mask));203203-204204- /* check with the cores we have woken up */205205- for (ncore = 0, i = 0; i < NLM_NR_NODES; i++)206206- ncore += hweight32(nlm_get_node(i)->coremask);207207-208208- pr_info("Detected (%dc%dt) %d Slave CPU(s)\n", ncore,209209- nlm_threads_per_core, num_cpus);210210-211211- /* switch NMI handler to boot CPUs */212212- nlm_set_nmi_handler(nlm_boot_secondary_cpus);213213-}214214-215215-static int nlm_parse_cpumask(cpumask_t *wakeup_mask)216216-{217217- uint32_t core0_thr_mask, core_thr_mask;218218- int threadmode, i, j;219219-220220- core0_thr_mask = 0;221221- for (i = 0; i < NLM_THREADS_PER_CORE; i++)222222- if (cpumask_test_cpu(i, wakeup_mask))223223- core0_thr_mask |= (1 << i);224224- switch (core0_thr_mask) {225225- case 1:226226- nlm_threads_per_core = 1;227227- threadmode = 0;228228- break;229229- case 3:230230- nlm_threads_per_core = 2;231231- threadmode = 2;232232- break;233233- case 0xf:234234- nlm_threads_per_core = 4;235235- threadmode = 3;236236- break;237237- default:238238- goto unsupp;239239- }240240-241241- /* Verify other cores CPU masks */242242- for (i = 0; i < NR_CPUS; i += NLM_THREADS_PER_CORE) {243243- core_thr_mask = 0;244244- for (j = 0; j < NLM_THREADS_PER_CORE; j++)245245- if (cpumask_test_cpu(i + j, wakeup_mask))246246- core_thr_mask |= (1 << j);247247- if (core_thr_mask != 0 && core_thr_mask != core0_thr_mask)248248- goto unsupp;249249- }250250- return threadmode;251251-252252-unsupp:253253- panic("Unsupported CPU mask %*pb", cpumask_pr_args(wakeup_mask));254254- return 0;255255-}256256-257257-int nlm_wakeup_secondary_cpus(void)258258-{259259- u32 *reset_data;260260- int threadmode;261261-262262- /* verify the mask and setup core config variables */263263- threadmode = nlm_parse_cpumask(&nlm_cpumask);264264-265265- /* Setup CPU init parameters */266266- reset_data = nlm_get_boot_data(BOOT_THREAD_MODE);267267- *reset_data = threadmode;268268-269269-#ifdef CONFIG_CPU_XLP270270- xlp_wakeup_secondary_cpus();271271-#else272272- xlr_wakeup_secondary_cpus();273273-#endif274274- return 0;275275-}276276-277277-const struct plat_smp_ops nlm_smp_ops = {278278- .send_ipi_single = nlm_send_ipi_single,279279- .send_ipi_mask = nlm_send_ipi_mask,280280- .init_secondary = nlm_init_secondary,281281- .smp_finish = nlm_smp_finish,282282- .boot_secondary = nlm_boot_secondary,283283- .smp_setup = nlm_smp_setup,284284- .prepare_cpus = nlm_prepare_cpus,285285-};
-141
arch/mips/netlogic/common/smpboot.S
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-3636-#include <asm/asm.h>3737-#include <asm/asm-offsets.h>3838-#include <asm/regdef.h>3939-#include <asm/mipsregs.h>4040-#include <asm/stackframe.h>4141-#include <asm/asmmacro.h>4242-#include <asm/addrspace.h>4343-4444-#include <asm/netlogic/common.h>4545-4646-#include <asm/netlogic/xlp-hal/iomap.h>4747-#include <asm/netlogic/xlp-hal/xlp.h>4848-#include <asm/netlogic/xlp-hal/sys.h>4949-#include <asm/netlogic/xlp-hal/cpucontrol.h>5050-5151- .set noreorder5252- .set noat5353- .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */5454-5555-/* Called by the boot cpu to wake up its sibling threads */5656-NESTED(xlp_boot_core0_siblings, PT_SIZE, sp)5757- /* CPU register contents lost when enabling threads, save them first */5858- SAVE_ALL5959- sync6060- /* find the location to which nlm_boot_siblings was relocated */6161- li t0, CKSEG1ADDR(RESET_VEC_PHYS)6262- PTR_LA t1, nlm_reset_entry6363- PTR_LA t2, nlm_boot_siblings6464- dsubu t2, t16565- daddu t2, t06666- /* call it */6767- jalr t26868- nop6969- RESTORE_ALL7070- jr ra7171- nop7272-END(xlp_boot_core0_siblings)7373-7474-NESTED(nlm_boot_secondary_cpus, 16, sp)7575- /* Initialize CP0 Status */7676- move t1, zero7777-#ifdef CONFIG_64BIT7878- ori t1, ST0_KX7979-#endif8080- mtc0 t1, CP0_STATUS8181- PTR_LA t1, nlm_next_sp8282- PTR_L sp, 0(t1)8383- PTR_LA t1, nlm_next_gp8484- PTR_L gp, 0(t1)8585-8686- /* a0 has the processor id */8787- mfc0 a0, CP0_EBASE8888- andi a0, 0x3ff /* a0 <- node/core */8989- PTR_LA t0, nlm_early_init_secondary9090- jalr t09191- nop9292-9393- PTR_LA t0, smp_bootstrap9494- jr t09595- nop9696-END(nlm_boot_secondary_cpus)9797-9898-/*9999- * In case of RMIboot bootloader which is used on XLR boards, the CPUs100100- * be already woken up and waiting in bootloader code.101101- * This will get them out of the bootloader code and into linux. Needed102102- * because the bootloader area will be taken and initialized by linux.103103- */104104-NESTED(nlm_rmiboot_preboot, 16, sp)105105- mfc0 t0, $15, 1 /* read ebase */106106- andi t0, 0x1f /* t0 has the processor_id() */107107- andi t2, t0, 0x3 /* thread num */108108- sll t0, 2 /* offset in cpu array */109109-110110- li t3, CKSEG1ADDR(RESET_DATA_PHYS)111111- ADDIU t1, t3, BOOT_CPU_READY112112- ADDU t1, t0113113- li t3, 1114114- sw t3, 0(t1)115115-116116- bnez t2, 1f /* skip thread programming */117117- nop /* for thread id != 0 */118118-119119- /*120120- * XLR MMU setup only for first thread in core121121- */122122- li t0, 0x400123123- mfcr t1, t0124124- li t2, 6 /* XLR thread mode mask */125125- nor t3, t2, zero126126- and t2, t1, t2 /* t2 - current thread mode */127127- li v0, CKSEG1ADDR(RESET_DATA_PHYS)128128- lw v1, BOOT_THREAD_MODE(v0) /* v1 - new thread mode */129129- sll v1, 1130130- beq v1, t2, 1f /* same as request value */131131- nop /* nothing to do */132132-133133- and t2, t1, t3 /* mask out old thread mode */134134- or t1, t2, v1 /* put in new value */135135- mtcr t1, t0 /* update core control */136136-137137- /* wait for NMI to hit */138138-1: wait139139- b 1b140140- nop141141-END(nlm_rmiboot_preboot)
-110
arch/mips/netlogic/common/time.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/init.h>3636-3737-#include <asm/time.h>3838-#include <asm/cpu-features.h>3939-4040-#include <asm/netlogic/interrupt.h>4141-#include <asm/netlogic/common.h>4242-#include <asm/netlogic/haldefs.h>4343-4444-#if defined(CONFIG_CPU_XLP)4545-#include <asm/netlogic/xlp-hal/iomap.h>4646-#include <asm/netlogic/xlp-hal/xlp.h>4747-#include <asm/netlogic/xlp-hal/sys.h>4848-#include <asm/netlogic/xlp-hal/pic.h>4949-#elif defined(CONFIG_CPU_XLR)5050-#include <asm/netlogic/xlr/iomap.h>5151-#include <asm/netlogic/xlr/pic.h>5252-#include <asm/netlogic/xlr/xlr.h>5353-#else5454-#error "Unknown CPU"5555-#endif5656-5757-unsigned int get_c0_compare_int(void)5858-{5959- return IRQ_TIMER;6060-}6161-6262-static u64 nlm_get_pic_timer(struct clocksource *cs)6363-{6464- uint64_t picbase = nlm_get_node(0)->picbase;6565-6666- return ~nlm_pic_read_timer(picbase, PIC_CLOCK_TIMER);6767-}6868-6969-static u64 nlm_get_pic_timer32(struct clocksource *cs)7070-{7171- uint64_t picbase = nlm_get_node(0)->picbase;7272-7373- return ~nlm_pic_read_timer32(picbase, PIC_CLOCK_TIMER);7474-}7575-7676-static struct clocksource csrc_pic = {7777- .name = "PIC",7878- .flags = CLOCK_SOURCE_IS_CONTINUOUS,7979-};8080-8181-static void nlm_init_pic_timer(void)8282-{8383- uint64_t picbase = nlm_get_node(0)->picbase;8484- u32 picfreq;8585-8686- nlm_pic_set_timer(picbase, PIC_CLOCK_TIMER, ~0ULL, 0, 0);8787- if (current_cpu_data.cputype == CPU_XLR) {8888- csrc_pic.mask = CLOCKSOURCE_MASK(32);8989- csrc_pic.read = nlm_get_pic_timer32;9090- } else {9191- csrc_pic.mask = CLOCKSOURCE_MASK(64);9292- csrc_pic.read = nlm_get_pic_timer;9393- }9494- csrc_pic.rating = 1000;9595- picfreq = pic_timer_freq();9696- clocksource_register_hz(&csrc_pic, picfreq);9797- pr_info("PIC clock source added, frequency %d\n", picfreq);9898-}9999-100100-void __init plat_time_init(void)101101-{102102- nlm_init_pic_timer();103103- mips_hpt_frequency = nlm_get_cpu_frequency();104104- if (current_cpu_type() == CPU_XLR)105105- preset_lpj = mips_hpt_frequency / (3 * HZ);106106- else107107- preset_lpj = mips_hpt_frequency / (2 * HZ);108108- pr_info("MIPS counter frequency [%ld]\n",109109- (unsigned long)mips_hpt_frequency);110110-}
···11-/*22- * Copyright (c) 2003-2014 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/dma-mapping.h>3636-#include <linux/kernel.h>3737-#include <linux/delay.h>3838-#include <linux/init.h>3939-#include <linux/pci.h>4040-#include <linux/irq.h>4141-#include <linux/bitops.h>4242-#include <linux/pci_ids.h>4343-#include <linux/nodemask.h>4444-4545-#include <asm/cpu.h>4646-#include <asm/mipsregs.h>4747-4848-#include <asm/netlogic/common.h>4949-#include <asm/netlogic/haldefs.h>5050-#include <asm/netlogic/mips-extns.h>5151-#include <asm/netlogic/xlp-hal/xlp.h>5252-#include <asm/netlogic/xlp-hal/iomap.h>5353-5454-#define SATA_CTL 0x05555-#define SATA_STATUS 0x1 /* Status Reg */5656-#define SATA_INT 0x2 /* Interrupt Reg */5757-#define SATA_INT_MASK 0x3 /* Interrupt Mask Reg */5858-#define SATA_BIU_TIMEOUT 0x45959-#define AXIWRSPERRLOG 0x56060-#define AXIRDSPERRLOG 0x66161-#define BiuTimeoutLow 0x76262-#define BiuTimeoutHi 0x86363-#define BiuSlvErLow 0x96464-#define BiuSlvErHi 0xa6565-#define IO_CONFIG_SWAP_DIS 0xb6666-#define CR_REG_TIMER 0xc6767-#define CORE_ID 0xd6868-#define AXI_SLAVE_OPT1 0xe6969-#define PHY_MEM_ACCESS 0xf7070-#define PHY0_CNTRL 0x107171-#define PHY0_STAT 0x117272-#define PHY0_RX_ALIGN 0x127373-#define PHY0_RX_EQ_LO 0x137474-#define PHY0_RX_EQ_HI 0x147575-#define PHY0_BIST_LOOP 0x157676-#define PHY1_CNTRL 0x167777-#define PHY1_STAT 0x177878-#define PHY1_RX_ALIGN 0x187979-#define PHY1_RX_EQ_LO 0x198080-#define PHY1_RX_EQ_HI 0x1a8181-#define PHY1_BIST_LOOP 0x1b8282-#define RdExBase 0x1c8383-#define RdExLimit 0x1d8484-#define CacheAllocBase 0x1e8585-#define CacheAllocLimit 0x1f8686-#define BiuSlaveCmdGstNum 0x208787-8888-/*SATA_CTL Bits */8989-#define SATA_RST_N BIT(0) /* Active low reset sata_core phy */9090-#define SataCtlReserve0 BIT(1)9191-#define M_CSYSREQ BIT(2) /* AXI master low power, not used */9292-#define S_CSYSREQ BIT(3) /* AXI slave low power, not used */9393-#define P0_CP_DET BIT(8) /* Reserved, bring in from pad */9494-#define P0_MP_SW BIT(9) /* Mech Switch */9595-#define P0_DISABLE BIT(10) /* disable p0 */9696-#define P0_ACT_LED_EN BIT(11) /* Active LED enable */9797-#define P0_IRST_HARD_SYNTH BIT(12) /* PHY hard synth reset */9898-#define P0_IRST_HARD_TXRX BIT(13) /* PHY lane hard reset */9999-#define P0_IRST_POR BIT(14) /* PHY power on reset*/100100-#define P0_IPDTXL BIT(15) /* PHY Tx lane dis/power down */101101-#define P0_IPDRXL BIT(16) /* PHY Rx lane dis/power down */102102-#define P0_IPDIPDMSYNTH BIT(17) /* PHY synthesizer dis/porwer down */103103-#define P0_CP_POD_EN BIT(18) /* CP_POD enable */104104-#define P0_AT_BYPASS BIT(19) /* P0 address translation by pass */105105-#define P1_CP_DET BIT(20) /* Reserved,Cold Detect */106106-#define P1_MP_SW BIT(21) /* Mech Switch */107107-#define P1_DISABLE BIT(22) /* disable p1 */108108-#define P1_ACT_LED_EN BIT(23) /* Active LED enable */109109-#define P1_IRST_HARD_SYNTH BIT(24) /* PHY hard synth reset */110110-#define P1_IRST_HARD_TXRX BIT(25) /* PHY lane hard reset */111111-#define P1_IRST_POR BIT(26) /* PHY power on reset*/112112-#define P1_IPDTXL BIT(27) /* PHY Tx lane dis/porwer down */113113-#define P1_IPDRXL BIT(28) /* PHY Rx lane dis/porwer down */114114-#define P1_IPDIPDMSYNTH BIT(29) /* PHY synthesizer dis/porwer down */115115-#define P1_CP_POD_EN BIT(30)116116-#define P1_AT_BYPASS BIT(31) /* P1 address translation by pass */117117-118118-/* Status register */119119-#define M_CACTIVE BIT(0) /* m_cactive, not used */120120-#define S_CACTIVE BIT(1) /* s_cactive, not used */121121-#define P0_PHY_READY BIT(8) /* phy is ready */122122-#define P0_CP_POD BIT(9) /* Cold PowerOn */123123-#define P0_SLUMBER BIT(10) /* power mode slumber */124124-#define P0_PATIAL BIT(11) /* power mode patial */125125-#define P0_PHY_SIG_DET BIT(12) /* phy dignal detect */126126-#define P0_PHY_CALI BIT(13) /* phy calibration done */127127-#define P1_PHY_READY BIT(16) /* phy is ready */128128-#define P1_CP_POD BIT(17) /* Cold PowerOn */129129-#define P1_SLUMBER BIT(18) /* power mode slumber */130130-#define P1_PATIAL BIT(19) /* power mode patial */131131-#define P1_PHY_SIG_DET BIT(20) /* phy dignal detect */132132-#define P1_PHY_CALI BIT(21) /* phy calibration done */133133-134134-/* SATA CR_REG_TIMER bits */135135-#define CR_TIME_SCALE (0x1000 << 0)136136-137137-/* SATA PHY specific registers start and end address */138138-#define RXCDRCALFOSC0 0x0065139139-#define CALDUTY 0x006e140140-#define RXDPIF 0x8065141141-#define PPMDRIFTMAX_HI 0x80A4142142-143143-#define nlm_read_sata_reg(b, r) nlm_read_reg(b, r)144144-#define nlm_write_sata_reg(b, r, v) nlm_write_reg(b, r, v)145145-#define nlm_get_sata_pcibase(node) \146146- nlm_pcicfg_base(XLP9XX_IO_SATA_OFFSET(node))147147-#define nlm_get_sata_regbase(node) \148148- (nlm_get_sata_pcibase(node) + 0x100)149149-150150-/* SATA PHY config for register block 1 0x0065 .. 0x006e */151151-static const u8 sata_phy_config1[] = {152152- 0xC9, 0xC9, 0x07, 0x07, 0x18, 0x18, 0x01, 0x01, 0x22, 0x00153153-};154154-155155-/* SATA PHY config for register block 2 0x8065 .. 0x80A4 */156156-static const u8 sata_phy_config2[] = {157157- 0xAA, 0x00, 0x4C, 0xC9, 0xC9, 0x07, 0x07, 0x18,158158- 0x18, 0x05, 0x0C, 0x10, 0x00, 0x10, 0x00, 0xFF,159159- 0xCF, 0xF7, 0xE1, 0xF5, 0xFD, 0xFD, 0xFF, 0xFF,160160- 0xFF, 0xFF, 0xE3, 0xE7, 0xDB, 0xF5, 0xFD, 0xFD,161161- 0xF5, 0xF5, 0xFF, 0xFF, 0xE3, 0xE7, 0xDB, 0xF5,162162- 0xFD, 0xFD, 0xF5, 0xF5, 0xFF, 0xFF, 0xFF, 0xF5,163163- 0x3F, 0x00, 0x32, 0x00, 0x03, 0x01, 0x05, 0x05,164164- 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x04,165165-};166166-167167-const int sata_phy_debug = 0; /* set to verify PHY writes */168168-169169-static void sata_clear_glue_reg(u64 regbase, u32 off, u32 bit)170170-{171171- u32 reg_val;172172-173173- reg_val = nlm_read_sata_reg(regbase, off);174174- nlm_write_sata_reg(regbase, off, (reg_val & ~bit));175175-}176176-177177-static void sata_set_glue_reg(u64 regbase, u32 off, u32 bit)178178-{179179- u32 reg_val;180180-181181- reg_val = nlm_read_sata_reg(regbase, off);182182- nlm_write_sata_reg(regbase, off, (reg_val | bit));183183-}184184-185185-static void write_phy_reg(u64 regbase, u32 addr, u32 physel, u8 data)186186-{187187- nlm_write_sata_reg(regbase, PHY_MEM_ACCESS,188188- (1u << 31) | (physel << 24) | (data << 16) | addr);189189- udelay(850);190190-}191191-192192-static u8 read_phy_reg(u64 regbase, u32 addr, u32 physel)193193-{194194- u32 val;195195-196196- nlm_write_sata_reg(regbase, PHY_MEM_ACCESS,197197- (0 << 31) | (physel << 24) | (0 << 16) | addr);198198- udelay(850);199199- val = nlm_read_sata_reg(regbase, PHY_MEM_ACCESS);200200- return (val >> 16) & 0xff;201201-}202202-203203-static void config_sata_phy(u64 regbase)204204-{205205- u32 port, i, reg;206206- u8 val;207207-208208- for (port = 0; port < 2; port++) {209209- for (i = 0, reg = RXCDRCALFOSC0; reg <= CALDUTY; reg++, i++)210210- write_phy_reg(regbase, reg, port, sata_phy_config1[i]);211211-212212- for (i = 0, reg = RXDPIF; reg <= PPMDRIFTMAX_HI; reg++, i++)213213- write_phy_reg(regbase, reg, port, sata_phy_config2[i]);214214-215215- /* Fix for PHY link up failures at lower temperatures */216216- write_phy_reg(regbase, 0x800F, port, 0x1f);217217-218218- val = read_phy_reg(regbase, 0x0029, port);219219- write_phy_reg(regbase, 0x0029, port, val | (0x7 << 1));220220-221221- val = read_phy_reg(regbase, 0x0056, port);222222- write_phy_reg(regbase, 0x0056, port, val & ~(1 << 3));223223-224224- val = read_phy_reg(regbase, 0x0018, port);225225- write_phy_reg(regbase, 0x0018, port, val & ~(0x7 << 0));226226- }227227-}228228-229229-static void check_phy_register(u64 regbase, u32 addr, u32 physel, u8 xdata)230230-{231231- u8 data;232232-233233- data = read_phy_reg(regbase, addr, physel);234234- pr_info("PHY read addr = 0x%x physel = %d data = 0x%x %s\n",235235- addr, physel, data, data == xdata ? "TRUE" : "FALSE");236236-}237237-238238-static void verify_sata_phy_config(u64 regbase)239239-{240240- u32 port, i, reg;241241-242242- for (port = 0; port < 2; port++) {243243- for (i = 0, reg = RXCDRCALFOSC0; reg <= CALDUTY; reg++, i++)244244- check_phy_register(regbase, reg, port,245245- sata_phy_config1[i]);246246-247247- for (i = 0, reg = RXDPIF; reg <= PPMDRIFTMAX_HI; reg++, i++)248248- check_phy_register(regbase, reg, port,249249- sata_phy_config2[i]);250250- }251251-}252252-253253-static void nlm_sata_firmware_init(int node)254254-{255255- u32 reg_val;256256- u64 regbase;257257- int n;258258-259259- pr_info("Initializing XLP9XX On-chip AHCI...\n");260260- regbase = nlm_get_sata_regbase(node);261261-262262- /* Reset port0 */263263- sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_POR);264264- sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_TXRX);265265- sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_SYNTH);266266- sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDTXL);267267- sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDRXL);268268- sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDIPDMSYNTH);269269-270270- /* port1 */271271- sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_POR);272272- sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_TXRX);273273- sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_SYNTH);274274- sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDTXL);275275- sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDRXL);276276- sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDIPDMSYNTH);277277- udelay(300);278278-279279- /* Set PHY */280280- sata_set_glue_reg(regbase, SATA_CTL, P0_IPDTXL);281281- sata_set_glue_reg(regbase, SATA_CTL, P0_IPDRXL);282282- sata_set_glue_reg(regbase, SATA_CTL, P0_IPDIPDMSYNTH);283283- sata_set_glue_reg(regbase, SATA_CTL, P1_IPDTXL);284284- sata_set_glue_reg(regbase, SATA_CTL, P1_IPDRXL);285285- sata_set_glue_reg(regbase, SATA_CTL, P1_IPDIPDMSYNTH);286286-287287- udelay(1000);288288- sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_POR);289289- udelay(1000);290290- sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_POR);291291- udelay(1000);292292-293293- /* setup PHY */294294- config_sata_phy(regbase);295295- if (sata_phy_debug)296296- verify_sata_phy_config(regbase);297297-298298- udelay(1000);299299- sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_TXRX);300300- sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_SYNTH);301301- sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_TXRX);302302- sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_SYNTH);303303- udelay(300);304304-305305- /* Override reset in serial PHY mode */306306- sata_set_glue_reg(regbase, CR_REG_TIMER, CR_TIME_SCALE);307307- /* Set reset SATA */308308- sata_set_glue_reg(regbase, SATA_CTL, SATA_RST_N);309309- sata_set_glue_reg(regbase, SATA_CTL, M_CSYSREQ);310310- sata_set_glue_reg(regbase, SATA_CTL, S_CSYSREQ);311311-312312- pr_debug("Waiting for PHYs to come up.\n");313313- n = 10000;314314- do {315315- reg_val = nlm_read_sata_reg(regbase, SATA_STATUS);316316- if ((reg_val & P1_PHY_READY) && (reg_val & P0_PHY_READY))317317- break;318318- udelay(10);319319- } while (--n > 0);320320-321321- if (reg_val & P0_PHY_READY)322322- pr_info("PHY0 is up.\n");323323- else324324- pr_info("PHY0 is down.\n");325325- if (reg_val & P1_PHY_READY)326326- pr_info("PHY1 is up.\n");327327- else328328- pr_info("PHY1 is down.\n");329329-330330- pr_info("XLP AHCI Init Done.\n");331331-}332332-333333-static int __init nlm_ahci_init(void)334334-{335335- int node;336336-337337- if (!cpu_is_xlp9xx())338338- return 0;339339- for (node = 0; node < NLM_NR_NODES; node++)340340- if (nlm_node_present(node))341341- nlm_sata_firmware_init(node);342342- return 0;343343-}344344-345345-static void nlm_sata_intr_ack(struct irq_data *data)346346-{347347- u64 regbase;348348- u32 val;349349- int node;350350-351351- node = data->irq / NLM_IRQS_PER_NODE;352352- regbase = nlm_get_sata_regbase(node);353353- val = nlm_read_sata_reg(regbase, SATA_INT);354354- sata_set_glue_reg(regbase, SATA_INT, val);355355-}356356-357357-static void nlm_sata_fixup_bar(struct pci_dev *dev)358358-{359359- dev->resource[5] = dev->resource[0];360360- memset(&dev->resource[0], 0, sizeof(dev->resource[0]));361361-}362362-363363-static void nlm_sata_fixup_final(struct pci_dev *dev)364364-{365365- u32 val;366366- u64 regbase;367367- int node;368368-369369- /* Find end bridge function to find node */370370- node = xlp_socdev_to_node(dev);371371- regbase = nlm_get_sata_regbase(node);372372-373373- /* clear pending interrupts and then enable them */374374- val = nlm_read_sata_reg(regbase, SATA_INT);375375- sata_set_glue_reg(regbase, SATA_INT, val);376376-377377- /* Enable only the core interrupt */378378- sata_set_glue_reg(regbase, SATA_INT_MASK, 0x1);379379-380380- dev->irq = nlm_irq_to_xirq(node, PIC_SATA_IRQ);381381- nlm_set_pic_extra_ack(node, PIC_SATA_IRQ, nlm_sata_intr_ack);382382-}383383-384384-arch_initcall(nlm_ahci_init);385385-386386-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_SATA,387387- nlm_sata_fixup_bar);388388-389389-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_SATA,390390- nlm_sata_fixup_final);
-209
arch/mips/netlogic/xlp/ahci-init.c
···11-/*22- * Copyright (c) 2003-2014 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/dma-mapping.h>3636-#include <linux/kernel.h>3737-#include <linux/delay.h>3838-#include <linux/init.h>3939-#include <linux/pci.h>4040-#include <linux/irq.h>4141-#include <linux/bitops.h>4242-4343-#include <asm/cpu.h>4444-#include <asm/mipsregs.h>4545-4646-#include <asm/netlogic/haldefs.h>4747-#include <asm/netlogic/xlp-hal/xlp.h>4848-#include <asm/netlogic/common.h>4949-#include <asm/netlogic/xlp-hal/iomap.h>5050-#include <asm/netlogic/mips-extns.h>5151-5252-#define SATA_CTL 0x05353-#define SATA_STATUS 0x1 /* Status Reg */5454-#define SATA_INT 0x2 /* Interrupt Reg */5555-#define SATA_INT_MASK 0x3 /* Interrupt Mask Reg */5656-#define SATA_CR_REG_TIMER 0x4 /* PHY Conrol Timer Reg */5757-#define SATA_CORE_ID 0x5 /* Core ID Reg */5858-#define SATA_AXI_SLAVE_OPT1 0x6 /* AXI Slave Options Reg */5959-#define SATA_PHY_LOS_LEV 0x7 /* PHY LOS Level Reg */6060-#define SATA_PHY_MULTI 0x8 /* PHY Multiplier Reg */6161-#define SATA_PHY_CLK_SEL 0x9 /* Clock Select Reg */6262-#define SATA_PHY_AMP1_GEN1 0xa /* PHY Transmit Amplitude Reg 1 */6363-#define SATA_PHY_AMP1_GEN2 0xb /* PHY Transmit Amplitude Reg 2 */6464-#define SATA_PHY_AMP1_GEN3 0xc /* PHY Transmit Amplitude Reg 3 */6565-#define SATA_PHY_PRE1 0xd /* PHY Transmit Preemphasis Reg 1 */6666-#define SATA_PHY_PRE2 0xe /* PHY Transmit Preemphasis Reg 2 */6767-#define SATA_PHY_PRE3 0xf /* PHY Transmit Preemphasis Reg 3 */6868-#define SATA_SPDMODE 0x10 /* Speed Mode Reg */6969-#define SATA_REFCLK 0x11 /* Reference Clock Control Reg */7070-#define SATA_BYTE_SWAP_DIS 0x12 /* byte swap disable */7171-7272-/*SATA_CTL Bits */7373-#define SATA_RST_N BIT(0)7474-#define PHY0_RESET_N BIT(16)7575-#define PHY1_RESET_N BIT(17)7676-#define PHY2_RESET_N BIT(18)7777-#define PHY3_RESET_N BIT(19)7878-#define M_CSYSREQ BIT(2)7979-#define S_CSYSREQ BIT(3)8080-8181-/*SATA_STATUS Bits */8282-#define P0_PHY_READY BIT(4)8383-#define P1_PHY_READY BIT(5)8484-#define P2_PHY_READY BIT(6)8585-#define P3_PHY_READY BIT(7)8686-8787-#define nlm_read_sata_reg(b, r) nlm_read_reg(b, r)8888-#define nlm_write_sata_reg(b, r, v) nlm_write_reg(b, r, v)8989-#define nlm_get_sata_pcibase(node) \9090- nlm_pcicfg_base(XLP_IO_SATA_OFFSET(node))9191-/* SATA device specific configuration registers are starts at 0x900 offset */9292-#define nlm_get_sata_regbase(node) \9393- (nlm_get_sata_pcibase(node) + 0x900)9494-9595-static void sata_clear_glue_reg(uint64_t regbase, uint32_t off, uint32_t bit)9696-{9797- uint32_t reg_val;9898-9999- reg_val = nlm_read_sata_reg(regbase, off);100100- nlm_write_sata_reg(regbase, off, (reg_val & ~bit));101101-}102102-103103-static void sata_set_glue_reg(uint64_t regbase, uint32_t off, uint32_t bit)104104-{105105- uint32_t reg_val;106106-107107- reg_val = nlm_read_sata_reg(regbase, off);108108- nlm_write_sata_reg(regbase, off, (reg_val | bit));109109-}110110-111111-static void nlm_sata_firmware_init(int node)112112-{113113- uint32_t reg_val;114114- uint64_t regbase;115115- int i;116116-117117- pr_info("XLP AHCI Initialization started.\n");118118- regbase = nlm_get_sata_regbase(node);119119-120120- /* Reset SATA */121121- sata_clear_glue_reg(regbase, SATA_CTL, SATA_RST_N);122122- /* Reset PHY */123123- sata_clear_glue_reg(regbase, SATA_CTL,124124- (PHY3_RESET_N | PHY2_RESET_N125125- | PHY1_RESET_N | PHY0_RESET_N));126126-127127- /* Set SATA */128128- sata_set_glue_reg(regbase, SATA_CTL, SATA_RST_N);129129- /* Set PHY */130130- sata_set_glue_reg(regbase, SATA_CTL,131131- (PHY3_RESET_N | PHY2_RESET_N132132- | PHY1_RESET_N | PHY0_RESET_N));133133-134134- pr_debug("Waiting for PHYs to come up.\n");135135- i = 0;136136- do {137137- reg_val = nlm_read_sata_reg(regbase, SATA_STATUS);138138- i++;139139- } while (((reg_val & 0xF0) != 0xF0) && (i < 10000));140140-141141- for (i = 0; i < 4; i++) {142142- if (reg_val & (P0_PHY_READY << i))143143- pr_info("PHY%d is up.\n", i);144144- else145145- pr_info("PHY%d is down.\n", i);146146- }147147-148148- pr_info("XLP AHCI init done.\n");149149-}150150-151151-static int __init nlm_ahci_init(void)152152-{153153- int node = 0;154154- int chip = read_c0_prid() & PRID_IMP_MASK;155155-156156- if (chip == PRID_IMP_NETLOGIC_XLP3XX)157157- nlm_sata_firmware_init(node);158158- return 0;159159-}160160-161161-static void nlm_sata_intr_ack(struct irq_data *data)162162-{163163- uint32_t val = 0;164164- uint64_t regbase;165165-166166- regbase = nlm_get_sata_regbase(nlm_nodeid());167167- val = nlm_read_sata_reg(regbase, SATA_INT);168168- sata_set_glue_reg(regbase, SATA_INT, val);169169-}170170-171171-static void nlm_sata_fixup_bar(struct pci_dev *dev)172172-{173173- /*174174- * The AHCI resource is in BAR 0, move it to175175- * BAR 5, where it is expected176176- */177177- dev->resource[5] = dev->resource[0];178178- memset(&dev->resource[0], 0, sizeof(dev->resource[0]));179179-}180180-181181-static void nlm_sata_fixup_final(struct pci_dev *dev)182182-{183183- uint32_t val;184184- uint64_t regbase;185185- int node = 0; /* XLP3XX does not support multi-node */186186-187187- regbase = nlm_get_sata_regbase(node);188188-189189- /* clear pending interrupts and then enable them */190190- val = nlm_read_sata_reg(regbase, SATA_INT);191191- sata_set_glue_reg(regbase, SATA_INT, val);192192-193193- /* Mask the core interrupt. If all the interrupts194194- * are enabled there are spurious interrupt flow195195- * happening, to avoid only enable core interrupt196196- * mask.197197- */198198- sata_set_glue_reg(regbase, SATA_INT_MASK, 0x1);199199-200200- dev->irq = PIC_SATA_IRQ;201201- nlm_set_pic_extra_ack(node, PIC_SATA_IRQ, nlm_sata_intr_ack);202202-}203203-204204-arch_initcall(nlm_ahci_init);205205-206206-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_SATA,207207- nlm_sata_fixup_bar);208208-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_SATA,209209- nlm_sata_fixup_final);
-121
arch/mips/netlogic/xlp/cop2-ex.c
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2013 Broadcom Corporation.77- *88- * based on arch/mips/cavium-octeon/cpu.c99- * Copyright (C) 2009 Wind River Systems,1010- * written by Ralf Baechle <ralf@linux-mips.org>1111- */1212-#include <linux/capability.h>1313-#include <linux/init.h>1414-#include <linux/irqflags.h>1515-#include <linux/notifier.h>1616-#include <linux/prefetch.h>1717-#include <linux/ptrace.h>1818-#include <linux/sched.h>1919-#include <linux/sched/task_stack.h>2020-2121-#include <asm/cop2.h>2222-#include <asm/current.h>2323-#include <asm/mipsregs.h>2424-#include <asm/page.h>2525-2626-#include <asm/netlogic/mips-extns.h>2727-2828-/*2929- * 64 bit ops are done in inline assembly to support 32 bit3030- * compilation3131- */3232-void nlm_cop2_save(struct nlm_cop2_state *r)3333-{3434- asm volatile(3535- ".set push\n"3636- ".set noat\n"3737- "dmfc2 $1, $0, 0\n"3838- "sd $1, 0(%1)\n"3939- "dmfc2 $1, $0, 1\n"4040- "sd $1, 8(%1)\n"4141- "dmfc2 $1, $0, 2\n"4242- "sd $1, 16(%1)\n"4343- "dmfc2 $1, $0, 3\n"4444- "sd $1, 24(%1)\n"4545- "dmfc2 $1, $1, 0\n"4646- "sd $1, 0(%2)\n"4747- "dmfc2 $1, $1, 1\n"4848- "sd $1, 8(%2)\n"4949- "dmfc2 $1, $1, 2\n"5050- "sd $1, 16(%2)\n"5151- "dmfc2 $1, $1, 3\n"5252- "sd $1, 24(%2)\n"5353- ".set pop\n"5454- : "=m"(*r)5555- : "r"(r->tx), "r"(r->rx));5656-5757- r->tx_msg_status = __read_32bit_c2_register($2, 0);5858- r->rx_msg_status = __read_32bit_c2_register($3, 0) & 0x0fffffff;5959-}6060-6161-void nlm_cop2_restore(struct nlm_cop2_state *r)6262-{6363- u32 rstat;6464-6565- asm volatile(6666- ".set push\n"6767- ".set noat\n"6868- "ld $1, 0(%1)\n"6969- "dmtc2 $1, $0, 0\n"7070- "ld $1, 8(%1)\n"7171- "dmtc2 $1, $0, 1\n"7272- "ld $1, 16(%1)\n"7373- "dmtc2 $1, $0, 2\n"7474- "ld $1, 24(%1)\n"7575- "dmtc2 $1, $0, 3\n"7676- "ld $1, 0(%2)\n"7777- "dmtc2 $1, $1, 0\n"7878- "ld $1, 8(%2)\n"7979- "dmtc2 $1, $1, 1\n"8080- "ld $1, 16(%2)\n"8181- "dmtc2 $1, $1, 2\n"8282- "ld $1, 24(%2)\n"8383- "dmtc2 $1, $1, 3\n"8484- ".set pop\n"8585- : : "m"(*r), "r"(r->tx), "r"(r->rx));8686-8787- __write_32bit_c2_register($2, 0, r->tx_msg_status);8888- rstat = __read_32bit_c2_register($3, 0) & 0xf0000000u;8989- __write_32bit_c2_register($3, 0, r->rx_msg_status | rstat);9090-}9191-9292-static int nlm_cu2_call(struct notifier_block *nfb, unsigned long action,9393- void *data)9494-{9595- unsigned long flags;9696- unsigned int status;9797-9898- switch (action) {9999- case CU2_EXCEPTION:100100- if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))101101- break;102102- local_irq_save(flags);103103- KSTK_STATUS(current) |= ST0_CU2;104104- status = read_c0_status();105105- write_c0_status(status | ST0_CU2);106106- nlm_cop2_restore(&(current->thread.cp2));107107- write_c0_status(status & ~ST0_CU2);108108- local_irq_restore(flags);109109- pr_info("COP2 access enabled for pid %d (%s)\n",110110- current->pid, current->comm);111111- return NOTIFY_BAD; /* Don't call default notifier */112112- }113113-114114- return NOTIFY_OK; /* Let default notifier send signals */115115-}116116-117117-static int __init nlm_cu2_setup(void)118118-{119119- return cu2_notifier(nlm_cu2_call, 0);120120-}121121-early_initcall(nlm_cu2_setup);
-95
arch/mips/netlogic/xlp/dt.c
···11-/*22- * Copyright 2003-2013 Broadcom Corporation.33- * All Rights Reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/memblock.h>3737-3838-#include <linux/of_fdt.h>3939-#include <linux/of_platform.h>4040-#include <linux/of_device.h>4141-4242-#include <asm/prom.h>4343-4444-extern u32 __dtb_xlp_evp_begin[], __dtb_xlp_svp_begin[], __dtb_xlp_fvp_begin[],4545- __dtb_xlp_gvp_begin[], __dtb_xlp_rvp_begin[];4646-static void *xlp_fdt_blob;4747-4848-void __init *xlp_dt_init(void *fdtp)4949-{5050- if (!fdtp) {5151- switch (current_cpu_data.processor_id & PRID_IMP_MASK) {5252-#ifdef CONFIG_DT_XLP_RVP5353- case PRID_IMP_NETLOGIC_XLP5XX:5454- fdtp = __dtb_xlp_rvp_begin;5555- break;5656-#endif5757-#ifdef CONFIG_DT_XLP_GVP5858- case PRID_IMP_NETLOGIC_XLP9XX:5959- fdtp = __dtb_xlp_gvp_begin;6060- break;6161-#endif6262-#ifdef CONFIG_DT_XLP_FVP6363- case PRID_IMP_NETLOGIC_XLP2XX:6464- fdtp = __dtb_xlp_fvp_begin;6565- break;6666-#endif6767-#ifdef CONFIG_DT_XLP_SVP6868- case PRID_IMP_NETLOGIC_XLP3XX:6969- fdtp = __dtb_xlp_svp_begin;7070- break;7171-#endif7272-#ifdef CONFIG_DT_XLP_EVP7373- case PRID_IMP_NETLOGIC_XLP8XX:7474- fdtp = __dtb_xlp_evp_begin;7575- break;7676-#endif7777- default:7878- /* Pick a built-in if any, and hope for the best */7979- fdtp = __dtb_start;8080- break;8181- }8282- }8383- xlp_fdt_blob = fdtp;8484- return fdtp;8585-}8686-8787-void __init xlp_early_init_devtree(void)8888-{8989- __dt_setup_arch(xlp_fdt_blob);9090-}9191-9292-void __init device_tree_init(void)9393-{9494- unflatten_and_copy_device_tree();9595-}
-508
arch/mips/netlogic/xlp/nlm_hal.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/types.h>3636-#include <linux/kernel.h>3737-#include <linux/mm.h>3838-#include <linux/delay.h>3939-4040-#include <asm/mipsregs.h>4141-#include <asm/time.h>4242-4343-#include <asm/netlogic/common.h>4444-#include <asm/netlogic/haldefs.h>4545-#include <asm/netlogic/xlp-hal/iomap.h>4646-#include <asm/netlogic/xlp-hal/xlp.h>4747-#include <asm/netlogic/xlp-hal/bridge.h>4848-#include <asm/netlogic/xlp-hal/pic.h>4949-#include <asm/netlogic/xlp-hal/sys.h>5050-5151-/* Main initialization */5252-void nlm_node_init(int node)5353-{5454- struct nlm_soc_info *nodep;5555-5656- nodep = nlm_get_node(node);5757- if (node == 0)5858- nodep->coremask = 1; /* node 0, boot cpu */5959- nodep->sysbase = nlm_get_sys_regbase(node);6060- nodep->picbase = nlm_get_pic_regbase(node);6161- nodep->ebase = read_c0_ebase() & MIPS_EBASE_BASE;6262- if (cpu_is_xlp9xx())6363- nodep->socbus = xlp9xx_get_socbus(node);6464- else6565- nodep->socbus = 0;6666- spin_lock_init(&nodep->piclock);6767-}6868-6969-static int xlp9xx_irq_to_irt(int irq)7070-{7171- switch (irq) {7272- case PIC_GPIO_IRQ:7373- return 12;7474- case PIC_I2C_0_IRQ:7575- return 125;7676- case PIC_I2C_1_IRQ:7777- return 126;7878- case PIC_I2C_2_IRQ:7979- return 127;8080- case PIC_I2C_3_IRQ:8181- return 128;8282- case PIC_9XX_XHCI_0_IRQ:8383- return 114;8484- case PIC_9XX_XHCI_1_IRQ:8585- return 115;8686- case PIC_9XX_XHCI_2_IRQ:8787- return 116;8888- case PIC_UART_0_IRQ:8989- return 133;9090- case PIC_UART_1_IRQ:9191- return 134;9292- case PIC_SATA_IRQ:9393- return 143;9494- case PIC_NAND_IRQ:9595- return 151;9696- case PIC_SPI_IRQ:9797- return 152;9898- case PIC_MMC_IRQ:9999- return 153;100100- case PIC_PCIE_LINK_LEGACY_IRQ(0):101101- case PIC_PCIE_LINK_LEGACY_IRQ(1):102102- case PIC_PCIE_LINK_LEGACY_IRQ(2):103103- case PIC_PCIE_LINK_LEGACY_IRQ(3):104104- return 191 + irq - PIC_PCIE_LINK_LEGACY_IRQ_BASE;105105- }106106- return -1;107107-}108108-109109-static int xlp_irq_to_irt(int irq)110110-{111111- uint64_t pcibase;112112- int devoff, irt;113113-114114- devoff = 0;115115- switch (irq) {116116- case PIC_UART_0_IRQ:117117- devoff = XLP_IO_UART0_OFFSET(0);118118- break;119119- case PIC_UART_1_IRQ:120120- devoff = XLP_IO_UART1_OFFSET(0);121121- break;122122- case PIC_MMC_IRQ:123123- devoff = XLP_IO_MMC_OFFSET(0);124124- break;125125- case PIC_I2C_0_IRQ: /* I2C will be fixed up */126126- case PIC_I2C_1_IRQ:127127- case PIC_I2C_2_IRQ:128128- case PIC_I2C_3_IRQ:129129- if (cpu_is_xlpii())130130- devoff = XLP2XX_IO_I2C_OFFSET(0);131131- else132132- devoff = XLP_IO_I2C0_OFFSET(0);133133- break;134134- case PIC_SATA_IRQ:135135- devoff = XLP_IO_SATA_OFFSET(0);136136- break;137137- case PIC_GPIO_IRQ:138138- devoff = XLP_IO_GPIO_OFFSET(0);139139- break;140140- case PIC_NAND_IRQ:141141- devoff = XLP_IO_NAND_OFFSET(0);142142- break;143143- case PIC_SPI_IRQ:144144- devoff = XLP_IO_SPI_OFFSET(0);145145- break;146146- default:147147- if (cpu_is_xlpii()) {148148- switch (irq) {149149- /* XLP2XX has three XHCI USB controller */150150- case PIC_2XX_XHCI_0_IRQ:151151- devoff = XLP2XX_IO_USB_XHCI0_OFFSET(0);152152- break;153153- case PIC_2XX_XHCI_1_IRQ:154154- devoff = XLP2XX_IO_USB_XHCI1_OFFSET(0);155155- break;156156- case PIC_2XX_XHCI_2_IRQ:157157- devoff = XLP2XX_IO_USB_XHCI2_OFFSET(0);158158- break;159159- }160160- } else {161161- switch (irq) {162162- case PIC_EHCI_0_IRQ:163163- devoff = XLP_IO_USB_EHCI0_OFFSET(0);164164- break;165165- case PIC_EHCI_1_IRQ:166166- devoff = XLP_IO_USB_EHCI1_OFFSET(0);167167- break;168168- case PIC_OHCI_0_IRQ:169169- devoff = XLP_IO_USB_OHCI0_OFFSET(0);170170- break;171171- case PIC_OHCI_1_IRQ:172172- devoff = XLP_IO_USB_OHCI1_OFFSET(0);173173- break;174174- case PIC_OHCI_2_IRQ:175175- devoff = XLP_IO_USB_OHCI2_OFFSET(0);176176- break;177177- case PIC_OHCI_3_IRQ:178178- devoff = XLP_IO_USB_OHCI3_OFFSET(0);179179- break;180180- }181181- }182182- }183183-184184- if (devoff != 0) {185185- uint32_t val;186186-187187- pcibase = nlm_pcicfg_base(devoff);188188- val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG);189189- if (val == 0xffffffff) {190190- irt = -1;191191- } else {192192- irt = val & 0xffff;193193- /* HW weirdness, I2C IRT entry has to be fixed up */194194- switch (irq) {195195- case PIC_I2C_1_IRQ:196196- irt = irt + 1; break;197197- case PIC_I2C_2_IRQ:198198- irt = irt + 2; break;199199- case PIC_I2C_3_IRQ:200200- irt = irt + 3; break;201201- }202202- }203203- } else if (irq >= PIC_PCIE_LINK_LEGACY_IRQ(0) &&204204- irq <= PIC_PCIE_LINK_LEGACY_IRQ(3)) {205205- /* HW bug, PCI IRT entries are bad on early silicon, fix */206206- irt = PIC_IRT_PCIE_LINK_INDEX(irq -207207- PIC_PCIE_LINK_LEGACY_IRQ_BASE);208208- } else {209209- irt = -1;210210- }211211- return irt;212212-}213213-214214-int nlm_irq_to_irt(int irq)215215-{216216- /* return -2 for irqs without 1-1 mapping */217217- if (irq >= PIC_PCIE_LINK_MSI_IRQ(0) && irq <= PIC_PCIE_LINK_MSI_IRQ(3))218218- return -2;219219- if (irq >= PIC_PCIE_MSIX_IRQ(0) && irq <= PIC_PCIE_MSIX_IRQ(3))220220- return -2;221221-222222- if (cpu_is_xlp9xx())223223- return xlp9xx_irq_to_irt(irq);224224- else225225- return xlp_irq_to_irt(irq);226226-}227227-228228-static unsigned int nlm_xlp2_get_core_frequency(int node, int core)229229-{230230- unsigned int pll_post_div, ctrl_val0, ctrl_val1, denom;231231- uint64_t num, sysbase, clockbase;232232-233233- if (cpu_is_xlp9xx()) {234234- clockbase = nlm_get_clock_regbase(node);235235- ctrl_val0 = nlm_read_sys_reg(clockbase,236236- SYS_9XX_CPU_PLL_CTRL0(core));237237- ctrl_val1 = nlm_read_sys_reg(clockbase,238238- SYS_9XX_CPU_PLL_CTRL1(core));239239- } else {240240- sysbase = nlm_get_node(node)->sysbase;241241- ctrl_val0 = nlm_read_sys_reg(sysbase,242242- SYS_CPU_PLL_CTRL0(core));243243- ctrl_val1 = nlm_read_sys_reg(sysbase,244244- SYS_CPU_PLL_CTRL1(core));245245- }246246-247247- /* Find PLL post divider value */248248- switch ((ctrl_val0 >> 24) & 0x7) {249249- case 1:250250- pll_post_div = 2;251251- break;252252- case 3:253253- pll_post_div = 4;254254- break;255255- case 7:256256- pll_post_div = 8;257257- break;258258- case 6:259259- pll_post_div = 16;260260- break;261261- case 0:262262- default:263263- pll_post_div = 1;264264- break;265265- }266266-267267- num = 1000000ULL * (400 * 3 + 100 * (ctrl_val1 & 0x3f));268268- denom = 3 * pll_post_div;269269- do_div(num, denom);270270-271271- return (unsigned int)num;272272-}273273-274274-static unsigned int nlm_xlp_get_core_frequency(int node, int core)275275-{276276- unsigned int pll_divf, pll_divr, dfs_div, ext_div;277277- unsigned int rstval, dfsval, denom;278278- uint64_t num, sysbase;279279-280280- sysbase = nlm_get_node(node)->sysbase;281281- rstval = nlm_read_sys_reg(sysbase, SYS_POWER_ON_RESET_CFG);282282- dfsval = nlm_read_sys_reg(sysbase, SYS_CORE_DFS_DIV_VALUE);283283- pll_divf = ((rstval >> 10) & 0x7f) + 1;284284- pll_divr = ((rstval >> 8) & 0x3) + 1;285285- ext_div = ((rstval >> 30) & 0x3) + 1;286286- dfs_div = ((dfsval >> (core * 4)) & 0xf) + 1;287287-288288- num = 800000000ULL * pll_divf;289289- denom = 3 * pll_divr * ext_div * dfs_div;290290- do_div(num, denom);291291-292292- return (unsigned int)num;293293-}294294-295295-unsigned int nlm_get_core_frequency(int node, int core)296296-{297297- if (cpu_is_xlpii())298298- return nlm_xlp2_get_core_frequency(node, core);299299- else300300- return nlm_xlp_get_core_frequency(node, core);301301-}302302-303303-/*304304- * Calculate PIC frequency from PLL registers.305305- * freq_out = (ref_freq/2 * (6 + ctrl2[7:0]) + ctrl2[20:8]/2^13) /306306- * ((2^ctrl0[7:5]) * Table(ctrl0[26:24]))307307- */308308-static unsigned int nlm_xlp2_get_pic_frequency(int node)309309-{310310- u32 ctrl_val0, ctrl_val2, vco_post_div, pll_post_div, cpu_xlp9xx;311311- u32 mdiv, fdiv, pll_out_freq_den, reg_select, ref_div, pic_div;312312- u64 sysbase, pll_out_freq_num, ref_clk_select, clockbase, ref_clk;313313-314314- sysbase = nlm_get_node(node)->sysbase;315315- clockbase = nlm_get_clock_regbase(node);316316- cpu_xlp9xx = cpu_is_xlp9xx();317317-318318- /* Find ref_clk_base */319319- if (cpu_xlp9xx)320320- ref_clk_select = (nlm_read_sys_reg(sysbase,321321- SYS_9XX_POWER_ON_RESET_CFG) >> 18) & 0x3;322322- else323323- ref_clk_select = (nlm_read_sys_reg(sysbase,324324- SYS_POWER_ON_RESET_CFG) >> 18) & 0x3;325325- switch (ref_clk_select) {326326- case 0:327327- ref_clk = 200000000ULL;328328- ref_div = 3;329329- break;330330- case 1:331331- ref_clk = 100000000ULL;332332- ref_div = 1;333333- break;334334- case 2:335335- ref_clk = 125000000ULL;336336- ref_div = 1;337337- break;338338- case 3:339339- ref_clk = 400000000ULL;340340- ref_div = 3;341341- break;342342- }343343-344344- /* Find the clock source PLL device for PIC */345345- if (cpu_xlp9xx) {346346- reg_select = nlm_read_sys_reg(clockbase,347347- SYS_9XX_CLK_DEV_SEL_REG) & 0x3;348348- switch (reg_select) {349349- case 0:350350- ctrl_val0 = nlm_read_sys_reg(clockbase,351351- SYS_9XX_PLL_CTRL0);352352- ctrl_val2 = nlm_read_sys_reg(clockbase,353353- SYS_9XX_PLL_CTRL2);354354- break;355355- case 1:356356- ctrl_val0 = nlm_read_sys_reg(clockbase,357357- SYS_9XX_PLL_CTRL0_DEVX(0));358358- ctrl_val2 = nlm_read_sys_reg(clockbase,359359- SYS_9XX_PLL_CTRL2_DEVX(0));360360- break;361361- case 2:362362- ctrl_val0 = nlm_read_sys_reg(clockbase,363363- SYS_9XX_PLL_CTRL0_DEVX(1));364364- ctrl_val2 = nlm_read_sys_reg(clockbase,365365- SYS_9XX_PLL_CTRL2_DEVX(1));366366- break;367367- case 3:368368- ctrl_val0 = nlm_read_sys_reg(clockbase,369369- SYS_9XX_PLL_CTRL0_DEVX(2));370370- ctrl_val2 = nlm_read_sys_reg(clockbase,371371- SYS_9XX_PLL_CTRL2_DEVX(2));372372- break;373373- }374374- } else {375375- reg_select = (nlm_read_sys_reg(sysbase,376376- SYS_CLK_DEV_SEL_REG) >> 22) & 0x3;377377- switch (reg_select) {378378- case 0:379379- ctrl_val0 = nlm_read_sys_reg(sysbase,380380- SYS_PLL_CTRL0);381381- ctrl_val2 = nlm_read_sys_reg(sysbase,382382- SYS_PLL_CTRL2);383383- break;384384- case 1:385385- ctrl_val0 = nlm_read_sys_reg(sysbase,386386- SYS_PLL_CTRL0_DEVX(0));387387- ctrl_val2 = nlm_read_sys_reg(sysbase,388388- SYS_PLL_CTRL2_DEVX(0));389389- break;390390- case 2:391391- ctrl_val0 = nlm_read_sys_reg(sysbase,392392- SYS_PLL_CTRL0_DEVX(1));393393- ctrl_val2 = nlm_read_sys_reg(sysbase,394394- SYS_PLL_CTRL2_DEVX(1));395395- break;396396- case 3:397397- ctrl_val0 = nlm_read_sys_reg(sysbase,398398- SYS_PLL_CTRL0_DEVX(2));399399- ctrl_val2 = nlm_read_sys_reg(sysbase,400400- SYS_PLL_CTRL2_DEVX(2));401401- break;402402- }403403- }404404-405405- vco_post_div = (ctrl_val0 >> 5) & 0x7;406406- pll_post_div = (ctrl_val0 >> 24) & 0x7;407407- mdiv = ctrl_val2 & 0xff;408408- fdiv = (ctrl_val2 >> 8) & 0x1fff;409409-410410- /* Find PLL post divider value */411411- switch (pll_post_div) {412412- case 1:413413- pll_post_div = 2;414414- break;415415- case 3:416416- pll_post_div = 4;417417- break;418418- case 7:419419- pll_post_div = 8;420420- break;421421- case 6:422422- pll_post_div = 16;423423- break;424424- case 0:425425- default:426426- pll_post_div = 1;427427- break;428428- }429429-430430- fdiv = fdiv/(1 << 13);431431- pll_out_freq_num = ((ref_clk >> 1) * (6 + mdiv)) + fdiv;432432- pll_out_freq_den = (1 << vco_post_div) * pll_post_div * ref_div;433433-434434- if (pll_out_freq_den > 0)435435- do_div(pll_out_freq_num, pll_out_freq_den);436436-437437- /* PIC post divider, which happens after PLL */438438- if (cpu_xlp9xx)439439- pic_div = nlm_read_sys_reg(clockbase,440440- SYS_9XX_CLK_DEV_DIV_REG) & 0x3;441441- else442442- pic_div = (nlm_read_sys_reg(sysbase,443443- SYS_CLK_DEV_DIV_REG) >> 22) & 0x3;444444- do_div(pll_out_freq_num, 1 << pic_div);445445-446446- return pll_out_freq_num;447447-}448448-449449-unsigned int nlm_get_pic_frequency(int node)450450-{451451- if (cpu_is_xlpii())452452- return nlm_xlp2_get_pic_frequency(node);453453- else454454- return 133333333;455455-}456456-457457-unsigned int nlm_get_cpu_frequency(void)458458-{459459- return nlm_get_core_frequency(0, 0);460460-}461461-462462-/*463463- * Fills upto 8 pairs of entries containing the DRAM map of a node464464- * if node < 0, get dram map for all nodes465465- */466466-int nlm_get_dram_map(int node, uint64_t *dram_map, int nentries)467467-{468468- uint64_t bridgebase, base, lim;469469- uint32_t val;470470- unsigned int barreg, limreg, xlatreg;471471- int i, n, rv;472472-473473- /* Look only at mapping on Node 0, we don't handle crazy configs */474474- bridgebase = nlm_get_bridge_regbase(0);475475- rv = 0;476476- for (i = 0; i < 8; i++) {477477- if (rv + 1 >= nentries)478478- break;479479- if (cpu_is_xlp9xx()) {480480- barreg = BRIDGE_9XX_DRAM_BAR(i);481481- limreg = BRIDGE_9XX_DRAM_LIMIT(i);482482- xlatreg = BRIDGE_9XX_DRAM_NODE_TRANSLN(i);483483- } else {484484- barreg = BRIDGE_DRAM_BAR(i);485485- limreg = BRIDGE_DRAM_LIMIT(i);486486- xlatreg = BRIDGE_DRAM_NODE_TRANSLN(i);487487- }488488- if (node >= 0) {489489- /* node specified, get node mapping of BAR */490490- val = nlm_read_bridge_reg(bridgebase, xlatreg);491491- n = (val >> 1) & 0x3;492492- if (n != node)493493- continue;494494- }495495- val = nlm_read_bridge_reg(bridgebase, barreg);496496- val = (val >> 12) & 0xfffff;497497- base = (uint64_t) val << 20;498498- val = nlm_read_bridge_reg(bridgebase, limreg);499499- val = (val >> 12) & 0xfffff;500500- if (val == 0) /* BAR not used */501501- continue;502502- lim = ((uint64_t)val + 1) << 20;503503- dram_map[rv] = base;504504- dram_map[rv + 1] = lim;505505- rv += 2;506506- }507507- return rv;508508-}
-174
arch/mips/netlogic/xlp/setup.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/of_fdt.h>3737-#include <linux/memblock.h>3838-3939-#include <asm/idle.h>4040-#include <asm/reboot.h>4141-#include <asm/time.h>4242-#include <asm/bootinfo.h>4343-4444-#include <asm/netlogic/haldefs.h>4545-#include <asm/netlogic/common.h>4646-4747-#include <asm/netlogic/xlp-hal/iomap.h>4848-#include <asm/netlogic/xlp-hal/xlp.h>4949-#include <asm/netlogic/xlp-hal/sys.h>5050-5151-uint64_t nlm_io_base;5252-struct nlm_soc_info nlm_nodes[NLM_NR_NODES];5353-cpumask_t nlm_cpumask = CPU_MASK_CPU0;5454-unsigned int nlm_threads_per_core;5555-5656-static void nlm_linux_exit(void)5757-{5858- uint64_t sysbase = nlm_get_node(0)->sysbase;5959-6060- if (cpu_is_xlp9xx())6161- nlm_write_sys_reg(sysbase, SYS_9XX_CHIP_RESET, 1);6262- else6363- nlm_write_sys_reg(sysbase, SYS_CHIP_RESET, 1);6464- for ( ; ; )6565- cpu_wait();6666-}6767-6868-static void nlm_fixup_mem(void)6969-{7070- const int pref_backup = 512;7171- struct memblock_region *mem;7272-7373- for_each_mem_region(mem) {7474- memblock_remove(mem->base + mem->size - pref_backup,7575- pref_backup);7676- }7777-}7878-7979-static void __init xlp_init_mem_from_bars(void)8080-{8181- uint64_t map[16];8282- int i, n;8383-8484- n = nlm_get_dram_map(-1, map, ARRAY_SIZE(map)); /* -1 : all nodes */8585- for (i = 0; i < n; i += 2) {8686- /* exclude 0x1000_0000-0x2000_0000, u-boot device */8787- if (map[i] <= 0x10000000 && map[i+1] > 0x10000000)8888- map[i+1] = 0x10000000;8989- if (map[i] > 0x10000000 && map[i] < 0x20000000)9090- map[i] = 0x20000000;9191-9292- memblock_add(map[i], map[i+1] - map[i]);9393- }9494-}9595-9696-void __init plat_mem_setup(void)9797-{9898-#ifdef CONFIG_SMP9999- nlm_wakeup_secondary_cpus();100100-101101- /* update TLB size after waking up threads */102102- current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1;103103-104104- register_smp_ops(&nlm_smp_ops);105105-#endif106106- _machine_restart = (void (*)(char *))nlm_linux_exit;107107- _machine_halt = nlm_linux_exit;108108- pm_power_off = nlm_linux_exit;109109-110110- /* memory and bootargs from DT */111111- xlp_early_init_devtree();112112-113113- if (memblock_end_of_DRAM() == 0) {114114- pr_info("Using DRAM BARs for memory map.\n");115115- xlp_init_mem_from_bars();116116- }117117- /* Calculate and setup wired entries for mapped kernel */118118- nlm_fixup_mem();119119-}120120-121121-const char *get_system_type(void)122122-{123123- switch (read_c0_prid() & PRID_IMP_MASK) {124124- case PRID_IMP_NETLOGIC_XLP9XX:125125- case PRID_IMP_NETLOGIC_XLP5XX:126126- case PRID_IMP_NETLOGIC_XLP2XX:127127- return "Broadcom XLPII Series";128128- default:129129- return "Netlogic XLP Series";130130- }131131-}132132-133133-void xlp_mmu_init(void)134134-{135135- u32 conf4;136136-137137- if (cpu_is_xlpii()) {138138- /* XLPII series has extended pagesize in config 4 */139139- conf4 = read_c0_config4() & ~0x1f00u;140140- write_c0_config4(conf4 | ((PAGE_SHIFT - 10) / 2 << 8));141141- } else {142142- /* enable extended TLB and Large Fixed TLB */143143- write_c0_config6(read_c0_config6() | 0x24);144144-145145- /* set page mask of extended Fixed TLB in config7 */146146- write_c0_config7(PM_DEFAULT_MASK >>147147- (13 + (ffz(PM_DEFAULT_MASK >> 13) / 2)));148148- }149149-}150150-151151-void nlm_percpu_init(int hwcpuid)152152-{153153-}154154-155155-void __init prom_init(void)156156-{157157- void *reset_vec;158158-159159- nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE);160160- nlm_init_boot_cpu();161161- xlp_mmu_init();162162- nlm_node_init(0);163163- xlp_dt_init((void *)(long)fw_arg0);164164-165165- /* Update reset entry point with CPU init code */166166- reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS);167167- memset(reset_vec, 0, RESET_VEC_SIZE);168168- memcpy(reset_vec, (void *)nlm_reset_entry,169169- (nlm_reset_entry_end - nlm_reset_entry));170170-171171-#ifdef CONFIG_SMP172172- cpumask_setall(&nlm_cpumask);173173-#endif174174-}
-288
arch/mips/netlogic/xlp/usb-init-xlp2.c
···11-/*22- * Copyright (c) 2003-2013 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/dma-mapping.h>3636-#include <linux/kernel.h>3737-#include <linux/delay.h>3838-#include <linux/init.h>3939-#include <linux/pci.h>4040-#include <linux/pci_ids.h>4141-#include <linux/platform_device.h>4242-#include <linux/irq.h>4343-4444-#include <asm/netlogic/common.h>4545-#include <asm/netlogic/haldefs.h>4646-#include <asm/netlogic/xlp-hal/iomap.h>4747-#include <asm/netlogic/xlp-hal/xlp.h>4848-4949-#define XLPII_USB3_CTL_0 0xc05050-#define XLPII_VAUXRST BIT(0)5151-#define XLPII_VCCRST BIT(1)5252-#define XLPII_NUM2PORT 95353-#define XLPII_NUM3PORT 135454-#define XLPII_RTUNEREQ BIT(20)5555-#define XLPII_MS_CSYSREQ BIT(21)5656-#define XLPII_XS_CSYSREQ BIT(22)5757-#define XLPII_RETENABLEN BIT(23)5858-#define XLPII_TX2RX BIT(24)5959-#define XLPII_XHCIREV BIT(25)6060-#define XLPII_ECCDIS BIT(26)6161-6262-#define XLPII_USB3_INT_REG 0xc26363-#define XLPII_USB3_INT_MASK 0xc36464-6565-#define XLPII_USB_PHY_TEST 0xc66666-#define XLPII_PRESET BIT(0)6767-#define XLPII_ATERESET BIT(1)6868-#define XLPII_LOOPEN BIT(2)6969-#define XLPII_TESTPDHSP BIT(3)7070-#define XLPII_TESTPDSSP BIT(4)7171-#define XLPII_TESTBURNIN BIT(5)7272-7373-#define XLPII_USB_PHY_LOS_LV 0xc97474-#define XLPII_LOSLEV 07575-#define XLPII_LOSBIAS 57676-#define XLPII_SQRXTX 87777-#define XLPII_TXBOOST 117878-#define XLPII_RSLKSEL 167979-#define XLPII_FSEL 208080-8181-#define XLPII_USB_RFCLK_REG 0xcc8282-#define XLPII_VVLD 308383-8484-#define nlm_read_usb_reg(b, r) nlm_read_reg(b, r)8585-#define nlm_write_usb_reg(b, r, v) nlm_write_reg(b, r, v)8686-8787-#define nlm_xlpii_get_usb_pcibase(node, inst) \8888- nlm_pcicfg_base(cpu_is_xlp9xx() ? \8989- XLP9XX_IO_USB_OFFSET(node, inst) : \9090- XLP2XX_IO_USB_OFFSET(node, inst))9191-#define nlm_xlpii_get_usb_regbase(node, inst) \9292- (nlm_xlpii_get_usb_pcibase(node, inst) + XLP_IO_PCI_HDRSZ)9393-9494-static void xlp2xx_usb_ack(struct irq_data *data)9595-{9696- u64 port_addr;9797-9898- switch (data->irq) {9999- case PIC_2XX_XHCI_0_IRQ:100100- port_addr = nlm_xlpii_get_usb_regbase(0, 1);101101- break;102102- case PIC_2XX_XHCI_1_IRQ:103103- port_addr = nlm_xlpii_get_usb_regbase(0, 2);104104- break;105105- case PIC_2XX_XHCI_2_IRQ:106106- port_addr = nlm_xlpii_get_usb_regbase(0, 3);107107- break;108108- default:109109- pr_err("No matching USB irq!\n");110110- return;111111- }112112- nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff);113113-}114114-115115-static void xlp9xx_usb_ack(struct irq_data *data)116116-{117117- u64 port_addr;118118- int node, irq;119119-120120- /* Find the node and irq on the node */121121- irq = data->irq % NLM_IRQS_PER_NODE;122122- node = data->irq / NLM_IRQS_PER_NODE;123123-124124- switch (irq) {125125- case PIC_9XX_XHCI_0_IRQ:126126- port_addr = nlm_xlpii_get_usb_regbase(node, 1);127127- break;128128- case PIC_9XX_XHCI_1_IRQ:129129- port_addr = nlm_xlpii_get_usb_regbase(node, 2);130130- break;131131- case PIC_9XX_XHCI_2_IRQ:132132- port_addr = nlm_xlpii_get_usb_regbase(node, 3);133133- break;134134- default:135135- pr_err("No matching USB irq %d node %d!\n", irq, node);136136- return;137137- }138138- nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff);139139-}140140-141141-static void nlm_xlpii_usb_hw_reset(int node, int port)142142-{143143- u64 port_addr, xhci_base, pci_base;144144- void __iomem *corebase;145145- u32 val;146146-147147- port_addr = nlm_xlpii_get_usb_regbase(node, port);148148-149149- /* Set frequency */150150- val = nlm_read_usb_reg(port_addr, XLPII_USB_PHY_LOS_LV);151151- val &= ~(0x3f << XLPII_FSEL);152152- val |= (0x27 << XLPII_FSEL);153153- nlm_write_usb_reg(port_addr, XLPII_USB_PHY_LOS_LV, val);154154-155155- val = nlm_read_usb_reg(port_addr, XLPII_USB_RFCLK_REG);156156- val |= (1 << XLPII_VVLD);157157- nlm_write_usb_reg(port_addr, XLPII_USB_RFCLK_REG, val);158158-159159- /* PHY reset */160160- val = nlm_read_usb_reg(port_addr, XLPII_USB_PHY_TEST);161161- val &= (XLPII_ATERESET | XLPII_LOOPEN | XLPII_TESTPDHSP162162- | XLPII_TESTPDSSP | XLPII_TESTBURNIN);163163- nlm_write_usb_reg(port_addr, XLPII_USB_PHY_TEST, val);164164-165165- /* Setup control register */166166- val = XLPII_VAUXRST | XLPII_VCCRST | (1 << XLPII_NUM2PORT)167167- | (1 << XLPII_NUM3PORT) | XLPII_MS_CSYSREQ | XLPII_XS_CSYSREQ168168- | XLPII_RETENABLEN | XLPII_XHCIREV;169169- nlm_write_usb_reg(port_addr, XLPII_USB3_CTL_0, val);170170-171171- /* Enable interrupts */172172- nlm_write_usb_reg(port_addr, XLPII_USB3_INT_MASK, 0x00000001);173173-174174- /* Clear all interrupts */175175- nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff);176176-177177- udelay(2000);178178-179179- /* XHCI configuration at PCI mem */180180- pci_base = nlm_xlpii_get_usb_pcibase(node, port);181181- xhci_base = nlm_read_usb_reg(pci_base, 0x4) & ~0xf;182182- corebase = ioremap(xhci_base, 0x10000);183183- if (!corebase)184184- return;185185-186186- writel(0x240002, corebase + 0xc2c0);187187- /* GCTL 0xc110 */188188- val = readl(corebase + 0xc110);189189- val &= ~(0x3 << 12);190190- val |= (1 << 12);191191- writel(val, corebase + 0xc110);192192- udelay(100);193193-194194- /* PHYCFG 0xc200 */195195- val = readl(corebase + 0xc200);196196- val &= ~(1 << 6);197197- writel(val, corebase + 0xc200);198198- udelay(100);199199-200200- /* PIPECTL 0xc2c0 */201201- val = readl(corebase + 0xc2c0);202202- val &= ~(1 << 17);203203- writel(val, corebase + 0xc2c0);204204-205205- iounmap(corebase);206206-}207207-208208-static int __init nlm_platform_xlpii_usb_init(void)209209-{210210- int node;211211-212212- if (!cpu_is_xlpii())213213- return 0;214214-215215- if (!cpu_is_xlp9xx()) {216216- /* XLP 2XX single node */217217- pr_info("Initializing 2XX USB Interface\n");218218- nlm_xlpii_usb_hw_reset(0, 1);219219- nlm_xlpii_usb_hw_reset(0, 2);220220- nlm_xlpii_usb_hw_reset(0, 3);221221- nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_0_IRQ, xlp2xx_usb_ack);222222- nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_1_IRQ, xlp2xx_usb_ack);223223- nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_2_IRQ, xlp2xx_usb_ack);224224- return 0;225225- }226226-227227- /* XLP 9XX, multi-node */228228- pr_info("Initializing 9XX/5XX USB Interface\n");229229- for (node = 0; node < NLM_NR_NODES; node++) {230230- if (!nlm_node_present(node))231231- continue;232232- nlm_xlpii_usb_hw_reset(node, 1);233233- nlm_xlpii_usb_hw_reset(node, 2);234234- nlm_xlpii_usb_hw_reset(node, 3);235235- nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_0_IRQ, xlp9xx_usb_ack);236236- nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_1_IRQ, xlp9xx_usb_ack);237237- nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_2_IRQ, xlp9xx_usb_ack);238238- }239239- return 0;240240-}241241-242242-arch_initcall(nlm_platform_xlpii_usb_init);243243-244244-static u64 xlp_usb_dmamask = ~(u32)0;245245-246246-/* Fixup the IRQ for USB devices which is exist on XLP9XX SOC PCIE bus */247247-static void nlm_xlp9xx_usb_fixup_final(struct pci_dev *dev)248248-{249249- int node;250250-251251- node = xlp_socdev_to_node(dev);252252- dev->dev.dma_mask = &xlp_usb_dmamask;253253- dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);254254- switch (dev->devfn) {255255- case 0x21:256256- dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_0_IRQ);257257- break;258258- case 0x22:259259- dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_1_IRQ);260260- break;261261- case 0x23:262262- dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_2_IRQ);263263- break;264264- }265265-}266266-267267-/* Fixup the IRQ for USB devices which is exist on XLP2XX SOC PCIE bus */268268-static void nlm_xlp2xx_usb_fixup_final(struct pci_dev *dev)269269-{270270- dev->dev.dma_mask = &xlp_usb_dmamask;271271- dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);272272- switch (dev->devfn) {273273- case 0x21:274274- dev->irq = PIC_2XX_XHCI_0_IRQ;275275- break;276276- case 0x22:277277- dev->irq = PIC_2XX_XHCI_1_IRQ;278278- break;279279- case 0x23:280280- dev->irq = PIC_2XX_XHCI_2_IRQ;281281- break;282282- }283283-}284284-285285-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_XHCI,286286- nlm_xlp9xx_usb_fixup_final);287287-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_XHCI,288288- nlm_xlp2xx_usb_fixup_final);
-149
arch/mips/netlogic/xlp/usb-init.c
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/dma-mapping.h>3636-#include <linux/kernel.h>3737-#include <linux/delay.h>3838-#include <linux/init.h>3939-#include <linux/pci.h>4040-#include <linux/platform_device.h>4141-4242-#include <asm/netlogic/haldefs.h>4343-#include <asm/netlogic/xlp-hal/iomap.h>4444-#include <asm/netlogic/xlp-hal/xlp.h>4545-4646-/*4747- * USB glue logic registers, used only during initialization4848- */4949-#define USB_CTL_0 0x015050-#define USB_PHY_0 0x0A5151-#define USB_PHY_RESET 0x015252-#define USB_PHY_PORT_RESET_0 0x105353-#define USB_PHY_PORT_RESET_1 0x205454-#define USB_CONTROLLER_RESET 0x015555-#define USB_INT_STATUS 0x0E5656-#define USB_INT_EN 0x0F5757-#define USB_PHY_INTERRUPT_EN 0x015858-#define USB_OHCI_INTERRUPT_EN 0x025959-#define USB_OHCI_INTERRUPT1_EN 0x046060-#define USB_OHCI_INTERRUPT2_EN 0x086161-#define USB_CTRL_INTERRUPT_EN 0x106262-6363-#define nlm_read_usb_reg(b, r) nlm_read_reg(b, r)6464-#define nlm_write_usb_reg(b, r, v) nlm_write_reg(b, r, v)6565-#define nlm_get_usb_pcibase(node, inst) \6666- nlm_pcicfg_base(XLP_IO_USB_OFFSET(node, inst))6767-#define nlm_get_usb_regbase(node, inst) \6868- (nlm_get_usb_pcibase(node, inst) + XLP_IO_PCI_HDRSZ)6969-7070-static void nlm_usb_intr_en(int node, int port)7171-{7272- uint32_t val;7373- uint64_t port_addr;7474-7575- port_addr = nlm_get_usb_regbase(node, port);7676- val = nlm_read_usb_reg(port_addr, USB_INT_EN);7777- val = USB_CTRL_INTERRUPT_EN | USB_OHCI_INTERRUPT_EN |7878- USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN;7979- nlm_write_usb_reg(port_addr, USB_INT_EN, val);8080-}8181-8282-static void nlm_usb_hw_reset(int node, int port)8383-{8484- uint64_t port_addr;8585- uint32_t val;8686-8787- /* reset USB phy */8888- port_addr = nlm_get_usb_regbase(node, port);8989- val = nlm_read_usb_reg(port_addr, USB_PHY_0);9090- val &= ~(USB_PHY_RESET | USB_PHY_PORT_RESET_0 | USB_PHY_PORT_RESET_1);9191- nlm_write_usb_reg(port_addr, USB_PHY_0, val);9292-9393- mdelay(100);9494- val = nlm_read_usb_reg(port_addr, USB_CTL_0);9595- val &= ~(USB_CONTROLLER_RESET);9696- val |= 0x4;9797- nlm_write_usb_reg(port_addr, USB_CTL_0, val);9898-}9999-100100-static int __init nlm_platform_usb_init(void)101101-{102102- if (cpu_is_xlpii())103103- return 0;104104-105105- pr_info("Initializing USB Interface\n");106106- nlm_usb_hw_reset(0, 0);107107- nlm_usb_hw_reset(0, 3);108108-109109- /* Enable PHY interrupts */110110- nlm_usb_intr_en(0, 0);111111- nlm_usb_intr_en(0, 3);112112-113113- return 0;114114-}115115-116116-arch_initcall(nlm_platform_usb_init);117117-118118-static u64 xlp_usb_dmamask = ~(u32)0;119119-120120-/* Fixup the IRQ for USB devices which is exist on XLP SOC PCIE bus */121121-static void nlm_usb_fixup_final(struct pci_dev *dev)122122-{123123- dev->dev.dma_mask = &xlp_usb_dmamask;124124- dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);125125- switch (dev->devfn) {126126- case 0x10:127127- dev->irq = PIC_EHCI_0_IRQ;128128- break;129129- case 0x11:130130- dev->irq = PIC_OHCI_0_IRQ;131131- break;132132- case 0x12:133133- dev->irq = PIC_OHCI_1_IRQ;134134- break;135135- case 0x13:136136- dev->irq = PIC_EHCI_1_IRQ;137137- break;138138- case 0x14:139139- dev->irq = PIC_OHCI_2_IRQ;140140- break;141141- case 0x15:142142- dev->irq = PIC_OHCI_3_IRQ;143143- break;144144- }145145-}146146-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_EHCI,147147- nlm_usb_fixup_final);148148-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_OHCI,149149- nlm_usb_fixup_final);
-212
arch/mips/netlogic/xlp/wakeup.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/threads.h>3737-3838-#include <asm/asm.h>3939-#include <asm/asm-offsets.h>4040-#include <asm/mipsregs.h>4141-#include <asm/addrspace.h>4242-#include <asm/string.h>4343-4444-#include <asm/netlogic/haldefs.h>4545-#include <asm/netlogic/common.h>4646-#include <asm/netlogic/mips-extns.h>4747-4848-#include <asm/netlogic/xlp-hal/iomap.h>4949-#include <asm/netlogic/xlp-hal/xlp.h>5050-#include <asm/netlogic/xlp-hal/pic.h>5151-#include <asm/netlogic/xlp-hal/sys.h>5252-5353-static int xlp_wakeup_core(uint64_t sysbase, int node, int core)5454-{5555- uint32_t coremask, value;5656- int count, resetreg;5757-5858- coremask = (1 << core);5959-6060- /* Enable CPU clock in case of 8xx/3xx */6161- if (!cpu_is_xlpii()) {6262- value = nlm_read_sys_reg(sysbase, SYS_CORE_DFS_DIS_CTRL);6363- value &= ~coremask;6464- nlm_write_sys_reg(sysbase, SYS_CORE_DFS_DIS_CTRL, value);6565- }6666-6767- /* On 9XX, mark coherent first */6868- if (cpu_is_xlp9xx()) {6969- value = nlm_read_sys_reg(sysbase, SYS_9XX_CPU_NONCOHERENT_MODE);7070- value &= ~coremask;7171- nlm_write_sys_reg(sysbase, SYS_9XX_CPU_NONCOHERENT_MODE, value);7272- }7373-7474- /* Remove CPU Reset */7575- resetreg = cpu_is_xlp9xx() ? SYS_9XX_CPU_RESET : SYS_CPU_RESET;7676- value = nlm_read_sys_reg(sysbase, resetreg);7777- value &= ~coremask;7878- nlm_write_sys_reg(sysbase, resetreg, value);7979-8080- /* We are done on 9XX */8181- if (cpu_is_xlp9xx())8282- return 1;8383-8484- /* Poll for CPU to mark itself coherent on other type of XLP */8585- count = 100000;8686- do {8787- value = nlm_read_sys_reg(sysbase, SYS_CPU_NONCOHERENT_MODE);8888- } while ((value & coremask) != 0 && --count > 0);8989-9090- return count != 0;9191-}9292-9393-static int wait_for_cpus(int cpu, int bootcpu)9494-{9595- volatile uint32_t *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY);9696- int i, count, notready;9797-9898- count = 0x800000;9999- do {100100- notready = nlm_threads_per_core;101101- for (i = 0; i < nlm_threads_per_core; i++)102102- if (cpu_ready[cpu + i] || (cpu + i) == bootcpu)103103- --notready;104104- } while (notready != 0 && --count > 0);105105-106106- return count != 0;107107-}108108-109109-static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)110110-{111111- struct nlm_soc_info *nodep;112112- uint64_t syspcibase, fusebase;113113- uint32_t syscoremask, mask, fusemask;114114- int core, n, cpu, ncores;115115-116116- for (n = 0; n < NLM_NR_NODES; n++) {117117- if (n != 0) {118118- /* check if node exists and is online */119119- if (cpu_is_xlp9xx()) {120120- int b = xlp9xx_get_socbus(n);121121- pr_info("Node %d SoC PCI bus %d.\n", n, b);122122- if (b == 0)123123- break;124124- } else {125125- syspcibase = nlm_get_sys_pcibase(n);126126- if (nlm_read_reg(syspcibase, 0) == 0xffffffff)127127- break;128128- }129129- nlm_node_init(n);130130- }131131-132132- /* read cores in reset from SYS */133133- nodep = nlm_get_node(n);134134-135135- if (cpu_is_xlp9xx()) {136136- fusebase = nlm_get_fuse_regbase(n);137137- fusemask = nlm_read_reg(fusebase, FUSE_9XX_DEVCFG6);138138- switch (read_c0_prid() & PRID_IMP_MASK) {139139- case PRID_IMP_NETLOGIC_XLP5XX:140140- mask = 0xff;141141- break;142142- case PRID_IMP_NETLOGIC_XLP9XX:143143- default:144144- mask = 0xfffff;145145- break;146146- }147147- } else {148148- fusemask = nlm_read_sys_reg(nodep->sysbase,149149- SYS_EFUSE_DEVICE_CFG_STATUS0);150150- switch (read_c0_prid() & PRID_IMP_MASK) {151151- case PRID_IMP_NETLOGIC_XLP3XX:152152- mask = 0xf;153153- break;154154- case PRID_IMP_NETLOGIC_XLP2XX:155155- mask = 0x3;156156- break;157157- case PRID_IMP_NETLOGIC_XLP8XX:158158- default:159159- mask = 0xff;160160- break;161161- }162162- }163163-164164- /*165165- * Fused out cores are set in the fusemask, and the remaining166166- * cores are renumbered to range 0 .. nactive-1167167- */168168- syscoremask = (1 << hweight32(~fusemask & mask)) - 1;169169-170170- pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask);171171- ncores = nlm_cores_per_node();172172- for (core = 0; core < ncores; core++) {173173- /* we will be on node 0 core 0 */174174- if (n == 0 && core == 0)175175- continue;176176-177177- /* see if the core exists */178178- if ((syscoremask & (1 << core)) == 0)179179- continue;180180-181181- /* see if at least the first hw thread is enabled */182182- cpu = (n * ncores + core) * NLM_THREADS_PER_CORE;183183- if (!cpumask_test_cpu(cpu, wakeup_mask))184184- continue;185185-186186- /* wake up the core */187187- if (!xlp_wakeup_core(nodep->sysbase, n, core))188188- continue;189189-190190- /* core is up */191191- nodep->coremask |= 1u << core;192192-193193- /* spin until the hw threads sets their ready */194194- if (!wait_for_cpus(cpu, 0))195195- pr_err("Node %d : timeout core %d\n", n, core);196196- }197197- }198198-}199199-200200-void xlp_wakeup_secondary_cpus(void)201201-{202202- /*203203- * In case of u-boot, the secondaries are in reset204204- * first wakeup core 0 threads205205- */206206- xlp_boot_core0_siblings();207207- if (!wait_for_cpus(0, 0))208208- pr_err("Node 0 : timeout core 0\n");209209-210210- /* now get other cores out of reset */211211- xlp_enable_secondary_cores(&nlm_cpumask);212212-}
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <asm/cpu-info.h>3636-#include <linux/irq.h>3737-#include <linux/interrupt.h>3838-3939-#include <asm/cpu.h>4040-#include <asm/mipsregs.h>4141-#include <asm/netlogic/xlr/fmn.h>4242-#include <asm/netlogic/xlr/xlr.h>4343-#include <asm/netlogic/common.h>4444-#include <asm/netlogic/haldefs.h>4545-4646-struct xlr_board_fmn_config xlr_board_fmn_config;4747-4848-static void __maybe_unused print_credit_config(struct xlr_fmn_info *fmn_info)4949-{5050- int bkt;5151-5252- pr_info("Bucket size :\n");5353- pr_info("Station\t: Size\n");5454- for (bkt = 0; bkt < 16; bkt++)5555- pr_info(" %d %d %d %d %d %d %d %d\n",5656- xlr_board_fmn_config.bucket_size[(bkt * 8) + 0],5757- xlr_board_fmn_config.bucket_size[(bkt * 8) + 1],5858- xlr_board_fmn_config.bucket_size[(bkt * 8) + 2],5959- xlr_board_fmn_config.bucket_size[(bkt * 8) + 3],6060- xlr_board_fmn_config.bucket_size[(bkt * 8) + 4],6161- xlr_board_fmn_config.bucket_size[(bkt * 8) + 5],6262- xlr_board_fmn_config.bucket_size[(bkt * 8) + 6],6363- xlr_board_fmn_config.bucket_size[(bkt * 8) + 7]);6464- pr_info("\n");6565-6666- pr_info("Credits distribution :\n");6767- pr_info("Station\t: Size\n");6868- for (bkt = 0; bkt < 16; bkt++)6969- pr_info(" %d %d %d %d %d %d %d %d\n",7070- fmn_info->credit_config[(bkt * 8) + 0],7171- fmn_info->credit_config[(bkt * 8) + 1],7272- fmn_info->credit_config[(bkt * 8) + 2],7373- fmn_info->credit_config[(bkt * 8) + 3],7474- fmn_info->credit_config[(bkt * 8) + 4],7575- fmn_info->credit_config[(bkt * 8) + 5],7676- fmn_info->credit_config[(bkt * 8) + 6],7777- fmn_info->credit_config[(bkt * 8) + 7]);7878- pr_info("\n");7979-}8080-8181-static void check_credit_distribution(void)8282-{8383- struct xlr_board_fmn_config *cfg = &xlr_board_fmn_config;8484- int bkt, n, total_credits, ncores;8585-8686- ncores = hweight32(nlm_current_node()->coremask);8787- for (bkt = 0; bkt < 128; bkt++) {8888- total_credits = 0;8989- for (n = 0; n < ncores; n++)9090- total_credits += cfg->cpu[n].credit_config[bkt];9191- total_credits += cfg->gmac[0].credit_config[bkt];9292- total_credits += cfg->gmac[1].credit_config[bkt];9393- total_credits += cfg->dma.credit_config[bkt];9494- total_credits += cfg->cmp.credit_config[bkt];9595- total_credits += cfg->sae.credit_config[bkt];9696- total_credits += cfg->xgmac[0].credit_config[bkt];9797- total_credits += cfg->xgmac[1].credit_config[bkt];9898- if (total_credits > cfg->bucket_size[bkt])9999- pr_err("ERROR: Bucket %d: credits (%d) > size (%d)\n",100100- bkt, total_credits, cfg->bucket_size[bkt]);101101- }102102- pr_info("Credit distribution complete.\n");103103-}104104-105105-/**106106- * setup_fmn_cc - Configure bucket size and credits for a device.107107- * @dev_info: FMN information structure for each devices108108- * @start_stn_id: Starting station id of dev_info109109- * @end_stn_id: End station id of dev_info110110- * @num_buckets: Total number of buckets for den_info111111- * @cpu_credits: Allowed credits to cpu for each devices pointing by dev_info112112- * @size: Size of the each buckets in the device station113113- *114114- * 'size' is the size of the buckets for the device. This size is115115- * distributed among all the CPUs116116- * so that all of them can send messages to the device.117117- *118118- * The device is also given 'cpu_credits' to send messages to the CPUs119119- */120120-static void setup_fmn_cc(struct xlr_fmn_info *dev_info, int start_stn_id,121121- int end_stn_id, int num_buckets, int cpu_credits, int size)122122-{123123- int i, j, num_core, n, credits_per_cpu;124124- struct xlr_fmn_info *cpu = xlr_board_fmn_config.cpu;125125-126126- num_core = hweight32(nlm_current_node()->coremask);127127- dev_info->num_buckets = num_buckets;128128- dev_info->start_stn_id = start_stn_id;129129- dev_info->end_stn_id = end_stn_id;130130-131131- n = num_core;132132- if (num_core == 3)133133- n = 4;134134-135135- for (i = start_stn_id; i <= end_stn_id; i++) {136136- xlr_board_fmn_config.bucket_size[i] = size;137137-138138- /* Dividing device credits equally to cpus */139139- credits_per_cpu = size / n;140140- for (j = 0; j < num_core; j++)141141- cpu[j].credit_config[i] = credits_per_cpu;142142-143143- /* credits left to distribute */144144- credits_per_cpu = size - (credits_per_cpu * num_core);145145-146146- /* distribute the remaining credits (if any), among cores */147147- for (j = 0; (j < num_core) && (credits_per_cpu >= 4); j++) {148148- cpu[j].credit_config[i] += 4;149149- credits_per_cpu -= 4;150150- }151151- }152152-153153- /* Distributing cpu per bucket credits to devices */154154- for (i = 0; i < num_core; i++) {155155- for (j = 0; j < FMN_CORE_NBUCKETS; j++)156156- dev_info->credit_config[(i * 8) + j] = cpu_credits;157157- }158158-}159159-160160-/*161161- * Each core has 256 slots and 8 buckets,162162- * Configure the 8 buckets each with 32 slots163163- */164164-static void setup_cpu_fmninfo(struct xlr_fmn_info *cpu, int num_core)165165-{166166- int i, j;167167-168168- for (i = 0; i < num_core; i++) {169169- cpu[i].start_stn_id = (8 * i);170170- cpu[i].end_stn_id = (8 * i + 8);171171-172172- for (j = cpu[i].start_stn_id; j < cpu[i].end_stn_id; j++)173173- xlr_board_fmn_config.bucket_size[j] = 32;174174- }175175-}176176-177177-/**178178- * xlr_board_info_setup - Setup FMN details179179- *180180- * Setup the FMN details for each devices according to the device available181181- * in each variant of XLR/XLS processor182182- */183183-void xlr_board_info_setup(void)184184-{185185- struct xlr_fmn_info *cpu = xlr_board_fmn_config.cpu;186186- struct xlr_fmn_info *gmac = xlr_board_fmn_config.gmac;187187- struct xlr_fmn_info *xgmac = xlr_board_fmn_config.xgmac;188188- struct xlr_fmn_info *dma = &xlr_board_fmn_config.dma;189189- struct xlr_fmn_info *cmp = &xlr_board_fmn_config.cmp;190190- struct xlr_fmn_info *sae = &xlr_board_fmn_config.sae;191191- int processor_id, num_core;192192-193193- num_core = hweight32(nlm_current_node()->coremask);194194- processor_id = read_c0_prid() & PRID_IMP_MASK;195195-196196- setup_cpu_fmninfo(cpu, num_core);197197- switch (processor_id) {198198- case PRID_IMP_NETLOGIC_XLS104:199199- case PRID_IMP_NETLOGIC_XLS108:200200- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,201201- FMN_STNID_GMAC0_TX3, 8, 16, 32);202202- setup_fmn_cc(dma, FMN_STNID_DMA_0,203203- FMN_STNID_DMA_3, 4, 8, 64);204204- setup_fmn_cc(sae, FMN_STNID_SEC0,205205- FMN_STNID_SEC1, 2, 8, 128);206206- break;207207-208208- case PRID_IMP_NETLOGIC_XLS204:209209- case PRID_IMP_NETLOGIC_XLS208:210210- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,211211- FMN_STNID_GMAC0_TX3, 8, 16, 32);212212- setup_fmn_cc(dma, FMN_STNID_DMA_0,213213- FMN_STNID_DMA_3, 4, 8, 64);214214- setup_fmn_cc(sae, FMN_STNID_SEC0,215215- FMN_STNID_SEC1, 2, 8, 128);216216- break;217217-218218- case PRID_IMP_NETLOGIC_XLS404:219219- case PRID_IMP_NETLOGIC_XLS408:220220- case PRID_IMP_NETLOGIC_XLS404B:221221- case PRID_IMP_NETLOGIC_XLS408B:222222- case PRID_IMP_NETLOGIC_XLS416B:223223- case PRID_IMP_NETLOGIC_XLS608B:224224- case PRID_IMP_NETLOGIC_XLS616B:225225- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,226226- FMN_STNID_GMAC0_TX3, 8, 8, 32);227227- setup_fmn_cc(&gmac[1], FMN_STNID_GMAC1_FR_0,228228- FMN_STNID_GMAC1_TX3, 8, 8, 32);229229- setup_fmn_cc(dma, FMN_STNID_DMA_0,230230- FMN_STNID_DMA_3, 4, 4, 64);231231- setup_fmn_cc(cmp, FMN_STNID_CMP_0,232232- FMN_STNID_CMP_3, 4, 4, 64);233233- setup_fmn_cc(sae, FMN_STNID_SEC0,234234- FMN_STNID_SEC1, 2, 8, 128);235235- break;236236-237237- case PRID_IMP_NETLOGIC_XLS412B:238238- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,239239- FMN_STNID_GMAC0_TX3, 8, 8, 32);240240- setup_fmn_cc(&gmac[1], FMN_STNID_GMAC1_FR_0,241241- FMN_STNID_GMAC1_TX3, 8, 8, 32);242242- setup_fmn_cc(dma, FMN_STNID_DMA_0,243243- FMN_STNID_DMA_3, 4, 4, 64);244244- setup_fmn_cc(cmp, FMN_STNID_CMP_0,245245- FMN_STNID_CMP_3, 4, 4, 64);246246- setup_fmn_cc(sae, FMN_STNID_SEC0,247247- FMN_STNID_SEC1, 2, 8, 128);248248- break;249249-250250- case PRID_IMP_NETLOGIC_XLR308:251251- case PRID_IMP_NETLOGIC_XLR308C:252252- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,253253- FMN_STNID_GMAC0_TX3, 8, 16, 32);254254- setup_fmn_cc(dma, FMN_STNID_DMA_0,255255- FMN_STNID_DMA_3, 4, 8, 64);256256- setup_fmn_cc(sae, FMN_STNID_SEC0,257257- FMN_STNID_SEC1, 2, 4, 128);258258- break;259259-260260- case PRID_IMP_NETLOGIC_XLR532:261261- case PRID_IMP_NETLOGIC_XLR532C:262262- case PRID_IMP_NETLOGIC_XLR516C:263263- case PRID_IMP_NETLOGIC_XLR508C:264264- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,265265- FMN_STNID_GMAC0_TX3, 8, 16, 32);266266- setup_fmn_cc(dma, FMN_STNID_DMA_0,267267- FMN_STNID_DMA_3, 4, 8, 64);268268- setup_fmn_cc(sae, FMN_STNID_SEC0,269269- FMN_STNID_SEC1, 2, 4, 128);270270- break;271271-272272- case PRID_IMP_NETLOGIC_XLR732:273273- case PRID_IMP_NETLOGIC_XLR716:274274- setup_fmn_cc(&xgmac[0], FMN_STNID_XMAC0_00_TX,275275- FMN_STNID_XMAC0_15_TX, 8, 0, 32);276276- setup_fmn_cc(&xgmac[1], FMN_STNID_XMAC1_00_TX,277277- FMN_STNID_XMAC1_15_TX, 8, 0, 32);278278- setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0,279279- FMN_STNID_GMAC0_TX3, 8, 24, 32);280280- setup_fmn_cc(dma, FMN_STNID_DMA_0,281281- FMN_STNID_DMA_3, 4, 4, 64);282282- setup_fmn_cc(sae, FMN_STNID_SEC0,283283- FMN_STNID_SEC1, 2, 4, 128);284284- break;285285- default:286286- pr_err("Unknown CPU with processor ID [%d]\n", processor_id);287287- pr_err("Error: Cannot initialize FMN credits.\n");288288- }289289-290290- check_credit_distribution();291291-292292-#if 0 /* debug */293293- print_credit_config(&cpu[0]);294294- print_credit_config(&gmac[0]);295295-#endif296296-}
-199
arch/mips/netlogic/xlr/fmn.c
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/irqreturn.h>3737-#include <linux/irq.h>3838-#include <linux/interrupt.h>3939-4040-#include <asm/mipsregs.h>4141-#include <asm/netlogic/interrupt.h>4242-#include <asm/netlogic/xlr/fmn.h>4343-#include <asm/netlogic/common.h>4444-4545-#define COP2_CC_INIT_CPU_DEST(dest, conf) \4646-do { \4747- nlm_write_c2_cc##dest(0, conf[(dest * 8) + 0]); \4848- nlm_write_c2_cc##dest(1, conf[(dest * 8) + 1]); \4949- nlm_write_c2_cc##dest(2, conf[(dest * 8) + 2]); \5050- nlm_write_c2_cc##dest(3, conf[(dest * 8) + 3]); \5151- nlm_write_c2_cc##dest(4, conf[(dest * 8) + 4]); \5252- nlm_write_c2_cc##dest(5, conf[(dest * 8) + 5]); \5353- nlm_write_c2_cc##dest(6, conf[(dest * 8) + 6]); \5454- nlm_write_c2_cc##dest(7, conf[(dest * 8) + 7]); \5555-} while (0)5656-5757-struct fmn_message_handler {5858- void (*action)(int, int, int, int, struct nlm_fmn_msg *, void *);5959- void *arg;6060-} msg_handlers[128];6161-6262-/*6363- * FMN interrupt handler. We configure the FMN so that any messages in6464- * any of the CPU buckets will trigger an interrupt on the CPU.6565- * The message can be from any device on the FMN (like NAE/SAE/DMA).6666- * The source station id is used to figure out which of the registered6767- * handlers have to be called.6868- */6969-static irqreturn_t fmn_message_handler(int irq, void *data)7070-{7171- struct fmn_message_handler *hndlr;7272- int bucket, rv;7373- int size = 0, code = 0, src_stnid = 0;7474- struct nlm_fmn_msg msg;7575- uint32_t mflags, bkt_status;7676-7777- mflags = nlm_cop2_enable_irqsave();7878- /* Disable message ring interrupt */7979- nlm_fmn_setup_intr(irq, 0);8080- while (1) {8181- /* 8 bkts per core, [24:31] each bit represents one bucket8282- * Bit is Zero if bucket is not empty */8383- bkt_status = (nlm_read_c2_status0() >> 24) & 0xff;8484- if (bkt_status == 0xff)8585- break;8686- for (bucket = 0; bucket < 8; bucket++) {8787- /* Continue on empty bucket */8888- if (bkt_status & (1 << bucket))8989- continue;9090- rv = nlm_fmn_receive(bucket, &size, &code, &src_stnid,9191- &msg);9292- if (rv != 0)9393- continue;9494-9595- hndlr = &msg_handlers[src_stnid];9696- if (hndlr->action == NULL)9797- pr_warn("No msgring handler for stnid %d\n",9898- src_stnid);9999- else {100100- nlm_cop2_disable_irqrestore(mflags);101101- hndlr->action(bucket, src_stnid, size, code,102102- &msg, hndlr->arg);103103- mflags = nlm_cop2_enable_irqsave();104104- }105105- }106106- }107107- /* Enable message ring intr, to any thread in core */108108- nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1);109109- nlm_cop2_disable_irqrestore(mflags);110110- return IRQ_HANDLED;111111-}112112-113113-void xlr_percpu_fmn_init(void)114114-{115115- struct xlr_fmn_info *cpu_fmn_info;116116- int *bucket_sizes;117117- uint32_t flags;118118- int id;119119-120120- BUG_ON(nlm_thread_id() != 0);121121- id = nlm_core_id();122122-123123- bucket_sizes = xlr_board_fmn_config.bucket_size;124124- cpu_fmn_info = &xlr_board_fmn_config.cpu[id];125125- flags = nlm_cop2_enable_irqsave();126126-127127- /* Setup bucket sizes for the core. */128128- nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]);129129- nlm_write_c2_bucksize(1, bucket_sizes[id * 8 + 1]);130130- nlm_write_c2_bucksize(2, bucket_sizes[id * 8 + 2]);131131- nlm_write_c2_bucksize(3, bucket_sizes[id * 8 + 3]);132132- nlm_write_c2_bucksize(4, bucket_sizes[id * 8 + 4]);133133- nlm_write_c2_bucksize(5, bucket_sizes[id * 8 + 5]);134134- nlm_write_c2_bucksize(6, bucket_sizes[id * 8 + 6]);135135- nlm_write_c2_bucksize(7, bucket_sizes[id * 8 + 7]);136136-137137- /*138138- * For sending FMN messages, we need credits on the destination139139- * bucket. Program the credits this core has on the 128 possible140140- * destination buckets.141141- * We cannot use a loop here, because the the first argument has142142- * to be a constant integer value.143143- */144144- COP2_CC_INIT_CPU_DEST(0, cpu_fmn_info->credit_config);145145- COP2_CC_INIT_CPU_DEST(1, cpu_fmn_info->credit_config);146146- COP2_CC_INIT_CPU_DEST(2, cpu_fmn_info->credit_config);147147- COP2_CC_INIT_CPU_DEST(3, cpu_fmn_info->credit_config);148148- COP2_CC_INIT_CPU_DEST(4, cpu_fmn_info->credit_config);149149- COP2_CC_INIT_CPU_DEST(5, cpu_fmn_info->credit_config);150150- COP2_CC_INIT_CPU_DEST(6, cpu_fmn_info->credit_config);151151- COP2_CC_INIT_CPU_DEST(7, cpu_fmn_info->credit_config);152152- COP2_CC_INIT_CPU_DEST(8, cpu_fmn_info->credit_config);153153- COP2_CC_INIT_CPU_DEST(9, cpu_fmn_info->credit_config);154154- COP2_CC_INIT_CPU_DEST(10, cpu_fmn_info->credit_config);155155- COP2_CC_INIT_CPU_DEST(11, cpu_fmn_info->credit_config);156156- COP2_CC_INIT_CPU_DEST(12, cpu_fmn_info->credit_config);157157- COP2_CC_INIT_CPU_DEST(13, cpu_fmn_info->credit_config);158158- COP2_CC_INIT_CPU_DEST(14, cpu_fmn_info->credit_config);159159- COP2_CC_INIT_CPU_DEST(15, cpu_fmn_info->credit_config);160160-161161- /* enable FMN interrupts on this CPU */162162- nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);163163- nlm_cop2_disable_irqrestore(flags);164164-}165165-166166-167167-/*168168- * Register a FMN message handler with respect to the source station id169169- * @stnid: source station id170170- * @action: Handler function pointer171171- */172172-int nlm_register_fmn_handler(int start_stnid, int end_stnid,173173- void (*action)(int, int, int, int, struct nlm_fmn_msg *, void *),174174- void *arg)175175-{176176- int sstnid;177177-178178- for (sstnid = start_stnid; sstnid <= end_stnid; sstnid++) {179179- msg_handlers[sstnid].arg = arg;180180- smp_wmb();181181- msg_handlers[sstnid].action = action;182182- }183183- pr_debug("Registered FMN msg handler for stnid %d-%d\n",184184- start_stnid, end_stnid);185185- return 0;186186-}187187-188188-void nlm_setup_fmn_irq(void)189189-{190190- uint32_t flags;191191-192192- /* request irq only once */193193- if (request_irq(IRQ_FMN, fmn_message_handler, IRQF_PERCPU, "fmn", NULL))194194- pr_err("Failed to request irq %d (fmn)\n", IRQ_FMN);195195-196196- flags = nlm_cop2_enable_irqsave();197197- nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);198198- nlm_cop2_disable_irqrestore(flags);199199-}
-216
arch/mips/netlogic/xlr/platform-flash.c
···11-/*22- * Copyright 2011, Netlogic Microsystems.33- * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>44- *55- * This file is licensed under the terms of the GNU General Public66- * License version 2. This program is licensed "as is" without any77- * warranty of any kind, whether express or implied.88- */99-1010-#include <linux/device.h>1111-#include <linux/platform_device.h>1212-#include <linux/kernel.h>1313-#include <linux/init.h>1414-#include <linux/io.h>1515-#include <linux/delay.h>1616-#include <linux/ioport.h>1717-#include <linux/resource.h>1818-#include <linux/spi/flash.h>1919-2020-#include <linux/mtd/mtd.h>2121-#include <linux/mtd/physmap.h>2222-#include <linux/mtd/platnand.h>2323-2424-#include <asm/netlogic/haldefs.h>2525-#include <asm/netlogic/xlr/iomap.h>2626-#include <asm/netlogic/xlr/flash.h>2727-#include <asm/netlogic/xlr/bridge.h>2828-#include <asm/netlogic/xlr/gpio.h>2929-#include <asm/netlogic/xlr/xlr.h>3030-3131-/*3232- * Default NOR partition layout3333- */3434-static struct mtd_partition xlr_nor_parts[] = {3535- {3636- .name = "User FS",3737- .offset = 0x800000,3838- .size = MTDPART_SIZ_FULL,3939- }4040-};4141-4242-/*4343- * Default NAND partition layout4444- */4545-static struct mtd_partition xlr_nand_parts[] = {4646- {4747- .name = "Root Filesystem",4848- .offset = 64 * 64 * 2048,4949- .size = 432 * 64 * 2048,5050- },5151- {5252- .name = "Home Filesystem",5353- .offset = MTDPART_OFS_APPEND,5454- .size = MTDPART_SIZ_FULL,5555- },5656-};5757-5858-/* Use PHYSMAP flash for NOR */5959-struct physmap_flash_data xlr_nor_data = {6060- .width = 2,6161- .parts = xlr_nor_parts,6262- .nr_parts = ARRAY_SIZE(xlr_nor_parts),6363-};6464-6565-static struct resource xlr_nor_res[] = {6666- {6767- .flags = IORESOURCE_MEM,6868- },6969-};7070-7171-static struct platform_device xlr_nor_dev = {7272- .name = "physmap-flash",7373- .dev = {7474- .platform_data = &xlr_nor_data,7575- },7676- .num_resources = ARRAY_SIZE(xlr_nor_res),7777- .resource = xlr_nor_res,7878-};7979-8080-/*8181- * Use "gen_nand" driver for NAND flash8282- *8383- * There seems to be no way to store a private pointer containing8484- * platform specific info in gen_nand drivier. We will use a global8585- * struct for now, since we currently have only one NAND chip per board.8686- */8787-struct xlr_nand_flash_priv {8888- int cs;8989- uint64_t flash_mmio;9090-};9191-9292-static struct xlr_nand_flash_priv nand_priv;9393-9494-static void xlr_nand_ctrl(struct nand_chip *chip, int cmd,9595- unsigned int ctrl)9696-{9797- if (ctrl & NAND_CLE)9898- nlm_write_reg(nand_priv.flash_mmio,9999- FLASH_NAND_CLE(nand_priv.cs), cmd);100100- else if (ctrl & NAND_ALE)101101- nlm_write_reg(nand_priv.flash_mmio,102102- FLASH_NAND_ALE(nand_priv.cs), cmd);103103-}104104-105105-struct platform_nand_data xlr_nand_data = {106106- .chip = {107107- .nr_chips = 1,108108- .nr_partitions = ARRAY_SIZE(xlr_nand_parts),109109- .chip_delay = 50,110110- .partitions = xlr_nand_parts,111111- },112112- .ctrl = {113113- .cmd_ctrl = xlr_nand_ctrl,114114- },115115-};116116-117117-static struct resource xlr_nand_res[] = {118118- {119119- .flags = IORESOURCE_MEM,120120- },121121-};122122-123123-static struct platform_device xlr_nand_dev = {124124- .name = "gen_nand",125125- .id = -1,126126- .num_resources = ARRAY_SIZE(xlr_nand_res),127127- .resource = xlr_nand_res,128128- .dev = {129129- .platform_data = &xlr_nand_data,130130- }131131-};132132-133133-/*134134- * XLR/XLS supports upto 8 devices on its FLASH interface. The value in135135- * FLASH_BAR (on the MEM/IO bridge) gives the base for mapping all the136136- * flash devices.137137- * Under this, each flash device has an offset and size given by the138138- * CSBASE_ADDR and CSBASE_MASK registers for the device.139139- *140140- * The CSBASE_ registers are expected to be setup by the bootloader.141141- */142142-static void setup_flash_resource(uint64_t flash_mmio,143143- uint64_t flash_map_base, int cs, struct resource *res)144144-{145145- u32 base, mask;146146-147147- base = nlm_read_reg(flash_mmio, FLASH_CSBASE_ADDR(cs));148148- mask = nlm_read_reg(flash_mmio, FLASH_CSADDR_MASK(cs));149149-150150- res->start = flash_map_base + ((unsigned long)base << 16);151151- res->end = res->start + (mask + 1) * 64 * 1024;152152-}153153-154154-static int __init xlr_flash_init(void)155155-{156156- uint64_t gpio_mmio, flash_mmio, flash_map_base;157157- u32 gpio_resetcfg, flash_bar;158158- int cs, boot_nand, boot_nor;159159-160160- /* Flash address bits 39:24 is in bridge flash BAR */161161- flash_bar = nlm_read_reg(nlm_io_base, BRIDGE_FLASH_BAR);162162- flash_map_base = (flash_bar & 0xffff0000) << 8;163163-164164- gpio_mmio = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET);165165- flash_mmio = nlm_mmio_base(NETLOGIC_IO_FLASH_OFFSET);166166-167167- /* Get the chip reset config */168168- gpio_resetcfg = nlm_read_reg(gpio_mmio, GPIO_PWRON_RESET_CFG_REG);169169-170170- /* Check for boot flash type */171171- boot_nor = boot_nand = 0;172172- if (nlm_chip_is_xls()) {173173- /* On XLS, check boot from NAND bit (GPIO reset reg bit 16) */174174- if (gpio_resetcfg & (1 << 16))175175- boot_nand = 1;176176-177177- /* check boot from PCMCIA, (GPIO reset reg bit 15 */178178- if ((gpio_resetcfg & (1 << 15)) == 0)179179- boot_nor = 1; /* not set, booted from NOR */180180- } else { /* XLR */181181- /* check boot from PCMCIA (bit 16 in GPIO reset on XLR) */182182- if ((gpio_resetcfg & (1 << 16)) == 0)183183- boot_nor = 1; /* not set, booted from NOR */184184- }185185-186186- /* boot flash at chip select 0 */187187- cs = 0;188188-189189- if (boot_nand) {190190- nand_priv.cs = cs;191191- nand_priv.flash_mmio = flash_mmio;192192- setup_flash_resource(flash_mmio, flash_map_base, cs,193193- xlr_nand_res);194194-195195- /* Initialize NAND flash at CS 0 */196196- nlm_write_reg(flash_mmio, FLASH_CSDEV_PARM(cs),197197- FLASH_NAND_CSDEV_PARAM);198198- nlm_write_reg(flash_mmio, FLASH_CSTIME_PARMA(cs),199199- FLASH_NAND_CSTIME_PARAMA);200200- nlm_write_reg(flash_mmio, FLASH_CSTIME_PARMB(cs),201201- FLASH_NAND_CSTIME_PARAMB);202202-203203- pr_info("ChipSelect %d: NAND Flash %pR\n", cs, xlr_nand_res);204204- return platform_device_register(&xlr_nand_dev);205205- }206206-207207- if (boot_nor) {208208- setup_flash_resource(flash_mmio, flash_map_base, cs,209209- xlr_nor_res);210210- pr_info("ChipSelect %d: NOR Flash %pR\n", cs, xlr_nor_res);211211- return platform_device_register(&xlr_nor_dev);212212- }213213- return 0;214214-}215215-216216-arch_initcall(xlr_flash_init);
-250
arch/mips/netlogic/xlr/platform.c
···11-/*22- * Copyright 2011, Netlogic Microsystems.33- * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>44- *55- * This file is licensed under the terms of the GNU General Public66- * License version 2. This program is licensed "as is" without any77- * warranty of any kind, whether express or implied.88- */99-1010-#include <linux/device.h>1111-#include <linux/platform_device.h>1212-#include <linux/kernel.h>1313-#include <linux/init.h>1414-#include <linux/resource.h>1515-#include <linux/serial_8250.h>1616-#include <linux/serial_reg.h>1717-#include <linux/i2c.h>1818-#include <linux/usb/ehci_pdriver.h>1919-#include <linux/usb/ohci_pdriver.h>2020-2121-#include <asm/netlogic/haldefs.h>2222-#include <asm/netlogic/xlr/iomap.h>2323-#include <asm/netlogic/xlr/pic.h>2424-#include <asm/netlogic/xlr/xlr.h>2525-2626-static unsigned int nlm_xlr_uart_in(struct uart_port *p, int offset)2727-{2828- uint64_t uartbase;2929- unsigned int value;3030-3131- /* sign extend to 64 bits, if needed */3232- uartbase = (uint64_t)(long)p->membase;3333- value = nlm_read_reg(uartbase, offset);3434-3535- /* See XLR/XLS errata */3636- if (offset == UART_MSR)3737- value ^= 0xF0;3838- else if (offset == UART_MCR)3939- value ^= 0x3;4040-4141- return value;4242-}4343-4444-static void nlm_xlr_uart_out(struct uart_port *p, int offset, int value)4545-{4646- uint64_t uartbase;4747-4848- /* sign extend to 64 bits, if needed */4949- uartbase = (uint64_t)(long)p->membase;5050-5151- /* See XLR/XLS errata */5252- if (offset == UART_MSR)5353- value ^= 0xF0;5454- else if (offset == UART_MCR)5555- value ^= 0x3;5656-5757- nlm_write_reg(uartbase, offset, value);5858-}5959-6060-#define PORT(_irq) \6161- { \6262- .irq = _irq, \6363- .regshift = 2, \6464- .iotype = UPIO_MEM32, \6565- .flags = (UPF_SKIP_TEST | \6666- UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF),\6767- .uartclk = PIC_CLK_HZ, \6868- .type = PORT_16550A, \6969- .serial_in = nlm_xlr_uart_in, \7070- .serial_out = nlm_xlr_uart_out, \7171- }7272-7373-static struct plat_serial8250_port xlr_uart_data[] = {7474- PORT(PIC_UART_0_IRQ),7575- PORT(PIC_UART_1_IRQ),7676- {},7777-};7878-7979-static struct platform_device uart_device = {8080- .name = "serial8250",8181- .id = PLAT8250_DEV_PLATFORM,8282- .dev = {8383- .platform_data = xlr_uart_data,8484- },8585-};8686-8787-static int __init nlm_uart_init(void)8888-{8989- unsigned long uartbase;9090-9191- uartbase = (unsigned long)nlm_mmio_base(NETLOGIC_IO_UART_0_OFFSET);9292- xlr_uart_data[0].membase = (void __iomem *)uartbase;9393- xlr_uart_data[0].mapbase = CPHYSADDR(uartbase);9494-9595- uartbase = (unsigned long)nlm_mmio_base(NETLOGIC_IO_UART_1_OFFSET);9696- xlr_uart_data[1].membase = (void __iomem *)uartbase;9797- xlr_uart_data[1].mapbase = CPHYSADDR(uartbase);9898-9999- return platform_device_register(&uart_device);100100-}101101-102102-arch_initcall(nlm_uart_init);103103-104104-#ifdef CONFIG_USB105105-/* Platform USB devices, only on XLS chips */106106-static u64 xls_usb_dmamask = ~(u32)0;107107-#define USB_PLATFORM_DEV(n, i, irq) \108108- { \109109- .name = n, \110110- .id = i, \111111- .num_resources = 2, \112112- .dev = { \113113- .dma_mask = &xls_usb_dmamask, \114114- .coherent_dma_mask = 0xffffffff, \115115- }, \116116- .resource = (struct resource[]) { \117117- { \118118- .flags = IORESOURCE_MEM, \119119- }, \120120- { \121121- .start = irq, \122122- .end = irq, \123123- .flags = IORESOURCE_IRQ, \124124- }, \125125- }, \126126- }127127-128128-static struct usb_ehci_pdata xls_usb_ehci_pdata = {129129- .caps_offset = 0,130130-};131131-132132-static struct usb_ohci_pdata xls_usb_ohci_pdata;133133-134134-static struct platform_device xls_usb_ehci_device =135135- USB_PLATFORM_DEV("ehci-platform", 0, PIC_USB_IRQ);136136-static struct platform_device xls_usb_ohci_device_0 =137137- USB_PLATFORM_DEV("ohci-platform", 1, PIC_USB_IRQ);138138-static struct platform_device xls_usb_ohci_device_1 =139139- USB_PLATFORM_DEV("ohci-platform", 2, PIC_USB_IRQ);140140-141141-static struct platform_device *xls_platform_devices[] = {142142- &xls_usb_ehci_device,143143- &xls_usb_ohci_device_0,144144- &xls_usb_ohci_device_1,145145-};146146-147147-int xls_platform_usb_init(void)148148-{149149- uint64_t usb_mmio, gpio_mmio;150150- unsigned long memres;151151- uint32_t val;152152-153153- if (!nlm_chip_is_xls())154154- return 0;155155-156156- gpio_mmio = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET);157157- usb_mmio = nlm_mmio_base(NETLOGIC_IO_USB_1_OFFSET);158158-159159- /* Clear Rogue Phy INTs */160160- nlm_write_reg(usb_mmio, 49, 0x10000000);161161- /* Enable all interrupts */162162- nlm_write_reg(usb_mmio, 50, 0x1f000000);163163-164164- /* Enable ports */165165- nlm_write_reg(usb_mmio, 1, 0x07000500);166166-167167- val = nlm_read_reg(gpio_mmio, 21);168168- if (((val >> 22) & 0x01) == 0) {169169- pr_info("Detected USB Device mode - Not supported!\n");170170- nlm_write_reg(usb_mmio, 0, 0x01000000);171171- return 0;172172- }173173-174174- pr_info("Detected USB Host mode - Adding XLS USB devices.\n");175175- /* Clear reset, host mode */176176- nlm_write_reg(usb_mmio, 0, 0x02000000);177177-178178- /* Memory resource for various XLS usb ports */179179- usb_mmio = nlm_mmio_base(NETLOGIC_IO_USB_0_OFFSET);180180- memres = CPHYSADDR((unsigned long)usb_mmio);181181- xls_usb_ehci_device.resource[0].start = memres;182182- xls_usb_ehci_device.resource[0].end = memres + 0x400 - 1;183183- xls_usb_ehci_device.dev.platform_data = &xls_usb_ehci_pdata;184184-185185- memres += 0x400;186186- xls_usb_ohci_device_0.resource[0].start = memres;187187- xls_usb_ohci_device_0.resource[0].end = memres + 0x400 - 1;188188- xls_usb_ohci_device_0.dev.platform_data = &xls_usb_ohci_pdata;189189-190190- memres += 0x400;191191- xls_usb_ohci_device_1.resource[0].start = memres;192192- xls_usb_ohci_device_1.resource[0].end = memres + 0x400 - 1;193193- xls_usb_ohci_device_1.dev.platform_data = &xls_usb_ohci_pdata;194194-195195- return platform_add_devices(xls_platform_devices,196196- ARRAY_SIZE(xls_platform_devices));197197-}198198-199199-arch_initcall(xls_platform_usb_init);200200-#endif201201-202202-#ifdef CONFIG_I2C203203-static struct i2c_board_info nlm_i2c_board_info1[] __initdata = {204204- /* All XLR boards have this RTC and Max6657 Temp Chip */205205- [0] = {206206- .type = "ds1374",207207- .addr = 0x68208208- },209209- [1] = {210210- .type = "lm90",211211- .addr = 0x4c212212- },213213-};214214-215215-static struct resource i2c_resources[] = {216216- [0] = {217217- .start = 0, /* filled at init */218218- .end = 0,219219- .flags = IORESOURCE_MEM,220220- },221221-};222222-223223-static struct platform_device nlm_xlr_i2c_1 = {224224- .name = "xlr-i2cbus",225225- .id = 1,226226- .num_resources = 1,227227- .resource = i2c_resources,228228-};229229-230230-static int __init nlm_i2c_init(void)231231-{232232- int err = 0;233233- unsigned int offset;234234-235235- /* I2C bus 0 does not have any useful devices, configure only bus 1 */236236- offset = NETLOGIC_IO_I2C_1_OFFSET;237237- nlm_xlr_i2c_1.resource[0].start = CPHYSADDR(nlm_mmio_base(offset));238238- nlm_xlr_i2c_1.resource[0].end = nlm_xlr_i2c_1.resource[0].start + 0xfff;239239-240240- platform_device_register(&nlm_xlr_i2c_1);241241-242242- err = i2c_register_board_info(1, nlm_i2c_board_info1,243243- ARRAY_SIZE(nlm_i2c_board_info1));244244- if (err < 0)245245- pr_err("nlm-i2c: cannot register board I2C devices\n");246246- return err;247247-}248248-249249-arch_initcall(nlm_i2c_init);250250-#endif
-206
arch/mips/netlogic/xlr/setup.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/kernel.h>3636-#include <linux/serial_8250.h>3737-#include <linux/memblock.h>3838-#include <linux/pm.h>3939-4040-#include <asm/idle.h>4141-#include <asm/reboot.h>4242-#include <asm/time.h>4343-#include <asm/bootinfo.h>4444-4545-#include <asm/netlogic/interrupt.h>4646-#include <asm/netlogic/psb-bootinfo.h>4747-#include <asm/netlogic/haldefs.h>4848-#include <asm/netlogic/common.h>4949-5050-#include <asm/netlogic/xlr/xlr.h>5151-#include <asm/netlogic/xlr/iomap.h>5252-#include <asm/netlogic/xlr/pic.h>5353-#include <asm/netlogic/xlr/gpio.h>5454-#include <asm/netlogic/xlr/fmn.h>5555-5656-uint64_t nlm_io_base = DEFAULT_NETLOGIC_IO_BASE;5757-struct psb_info nlm_prom_info;5858-5959-/* default to uniprocessor */6060-unsigned int nlm_threads_per_core = 1;6161-struct nlm_soc_info nlm_nodes[NLM_NR_NODES];6262-cpumask_t nlm_cpumask = CPU_MASK_CPU0;6363-6464-static void nlm_linux_exit(void)6565-{6666- uint64_t gpiobase;6767-6868- gpiobase = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET);6969- /* trigger a chip reset by writing 1 to GPIO_SWRESET_REG */7070- nlm_write_reg(gpiobase, GPIO_SWRESET_REG, 1);7171- for ( ; ; )7272- cpu_wait();7373-}7474-7575-void __init plat_mem_setup(void)7676-{7777- _machine_restart = (void (*)(char *))nlm_linux_exit;7878- _machine_halt = nlm_linux_exit;7979- pm_power_off = nlm_linux_exit;8080-}8181-8282-const char *get_system_type(void)8383-{8484- return "Netlogic XLR/XLS Series";8585-}8686-8787-unsigned int nlm_get_cpu_frequency(void)8888-{8989- return (unsigned int)nlm_prom_info.cpu_frequency;9090-}9191-9292-void nlm_percpu_init(int hwcpuid)9393-{9494- if (hwcpuid % 4 == 0)9595- xlr_percpu_fmn_init();9696-}9797-9898-static void __init build_arcs_cmdline(int *argv)9999-{100100- int i, remain, len;101101- char *arg;102102-103103- remain = sizeof(arcs_cmdline) - 1;104104- arcs_cmdline[0] = '\0';105105- for (i = 0; argv[i] != 0; i++) {106106- arg = (char *)(long)argv[i];107107- len = strlen(arg);108108- if (len + 1 > remain)109109- break;110110- strcat(arcs_cmdline, arg);111111- strcat(arcs_cmdline, " ");112112- remain -= len + 1;113113- }114114-115115- /* Add the default options here */116116- if ((strstr(arcs_cmdline, "console=")) == NULL) {117117- arg = "console=ttyS0,38400 ";118118- len = strlen(arg);119119- if (len > remain)120120- goto fail;121121- strcat(arcs_cmdline, arg);122122- remain -= len;123123- }124124-#ifdef CONFIG_BLK_DEV_INITRD125125- if ((strstr(arcs_cmdline, "rdinit=")) == NULL) {126126- arg = "rdinit=/sbin/init ";127127- len = strlen(arg);128128- if (len > remain)129129- goto fail;130130- strcat(arcs_cmdline, arg);131131- remain -= len;132132- }133133-#endif134134- return;135135-fail:136136- panic("Cannot add %s, command line too big!", arg);137137-}138138-139139-static void prom_add_memory(void)140140-{141141- struct nlm_boot_mem_map *bootm;142142- u64 start, size;143143- u64 pref_backup = 512; /* avoid pref walking beyond end */144144- int i;145145-146146- bootm = (void *)(long)nlm_prom_info.psb_mem_map;147147- for (i = 0; i < bootm->nr_map; i++) {148148- if (bootm->map[i].type != NLM_BOOT_MEM_RAM)149149- continue;150150- start = bootm->map[i].addr;151151- size = bootm->map[i].size;152152-153153- /* Work around for using bootloader mem */154154- if (i == 0 && start == 0 && size == 0x0c000000)155155- size = 0x0ff00000;156156-157157- memblock_add(start, size - pref_backup);158158- }159159-}160160-161161-static void nlm_init_node(void)162162-{163163- struct nlm_soc_info *nodep;164164-165165- nodep = nlm_current_node();166166- nodep->picbase = nlm_mmio_base(NETLOGIC_IO_PIC_OFFSET);167167- nodep->ebase = read_c0_ebase() & MIPS_EBASE_BASE;168168- spin_lock_init(&nodep->piclock);169169-}170170-171171-void __init prom_init(void)172172-{173173- int *argv, *envp; /* passed as 32 bit ptrs */174174- struct psb_info *prom_infop;175175- void *reset_vec;176176-#ifdef CONFIG_SMP177177- int i;178178-#endif179179-180180- /* truncate to 32 bit and sign extend all args */181181- argv = (int *)(long)(int)fw_arg1;182182- envp = (int *)(long)(int)fw_arg2;183183- prom_infop = (struct psb_info *)(long)(int)fw_arg3;184184-185185- nlm_prom_info = *prom_infop;186186- nlm_init_node();187187-188188- /* Update reset entry point with CPU init code */189189- reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS);190190- memset(reset_vec, 0, RESET_VEC_SIZE);191191- memcpy(reset_vec, (void *)nlm_reset_entry,192192- (nlm_reset_entry_end - nlm_reset_entry));193193-194194- build_arcs_cmdline(argv);195195- prom_add_memory();196196-197197-#ifdef CONFIG_SMP198198- for (i = 0; i < 32; i++)199199- if (nlm_prom_info.online_cpu_map & (1 << i))200200- cpumask_set_cpu(i, &nlm_cpumask);201201- nlm_wakeup_secondary_cpus();202202- register_smp_ops(&nlm_smp_ops);203203-#endif204204- xlr_board_info_setup();205205- xlr_percpu_fmn_init();206206-}
-85
arch/mips/netlogic/xlr/wakeup.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/delay.h>3636-#include <linux/threads.h>3737-3838-#include <asm/asm.h>3939-#include <asm/asm-offsets.h>4040-#include <asm/mipsregs.h>4141-#include <asm/addrspace.h>4242-#include <asm/string.h>4343-4444-#include <asm/netlogic/haldefs.h>4545-#include <asm/netlogic/common.h>4646-#include <asm/netlogic/mips-extns.h>4747-4848-#include <asm/netlogic/xlr/iomap.h>4949-#include <asm/netlogic/xlr/pic.h>5050-5151-int xlr_wakeup_secondary_cpus(void)5252-{5353- struct nlm_soc_info *nodep;5454- unsigned int i, j, boot_cpu;5555- volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY);5656-5757- /*5858- * In case of RMI boot, hit with NMI to get the cores5959- * from bootloader to linux code.6060- */6161- nodep = nlm_get_node(0);6262- boot_cpu = hard_smp_processor_id();6363- nlm_set_nmi_handler(nlm_rmiboot_preboot);6464- for (i = 0; i < NR_CPUS; i++) {6565- if (i == boot_cpu || !cpumask_test_cpu(i, &nlm_cpumask))6666- continue;6767- nlm_pic_send_ipi(nodep->picbase, i, 1, 1); /* send NMI */6868- }6969-7070- /* Fill up the coremask early */7171- nodep->coremask = 1;7272- for (i = 1; i < nlm_cores_per_node(); i++) {7373- for (j = 1000000; j > 0; j--) {7474- if (cpu_ready[i * NLM_THREADS_PER_CORE])7575- break;7676- udelay(10);7777- }7878- if (j != 0)7979- nodep->coremask |= (1u << i);8080- else8181- pr_err("Failed to wakeup core %d\n", i);8282- }8383-8484- return 0;8585-}
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/types.h>3636-#include <linux/pci.h>3737-#include <linux/kernel.h>3838-#include <linux/init.h>3939-#include <linux/msi.h>4040-#include <linux/mm.h>4141-#include <linux/irq.h>4242-#include <linux/irqdesc.h>4343-#include <linux/console.h>4444-4545-#include <asm/io.h>4646-4747-#include <asm/netlogic/interrupt.h>4848-#include <asm/netlogic/haldefs.h>4949-#include <asm/netlogic/common.h>5050-#include <asm/netlogic/mips-extns.h>5151-5252-#include <asm/netlogic/xlp-hal/iomap.h>5353-#include <asm/netlogic/xlp-hal/xlp.h>5454-#include <asm/netlogic/xlp-hal/pic.h>5555-#include <asm/netlogic/xlp-hal/pcibus.h>5656-#include <asm/netlogic/xlp-hal/bridge.h>5757-5858-#define XLP_MSIVEC_PER_LINK 325959-#define XLP_MSIXVEC_TOTAL (cpu_is_xlp9xx() ? 128 : 32)6060-#define XLP_MSIXVEC_PER_LINK (cpu_is_xlp9xx() ? 32 : 8)6161-6262-/* 128 MSI irqs per node, mapped starting at NLM_MSI_VEC_BASE */6363-static inline int nlm_link_msiirq(int link, int msivec)6464-{6565- return NLM_MSI_VEC_BASE + link * XLP_MSIVEC_PER_LINK + msivec;6666-}6767-6868-/* get the link MSI vector from irq number */6969-static inline int nlm_irq_msivec(int irq)7070-{7171- return (irq - NLM_MSI_VEC_BASE) % XLP_MSIVEC_PER_LINK;7272-}7373-7474-/* get the link from the irq number */7575-static inline int nlm_irq_msilink(int irq)7676-{7777- int total_msivec = XLP_MSIVEC_PER_LINK * PCIE_NLINKS;7878-7979- return ((irq - NLM_MSI_VEC_BASE) % total_msivec) /8080- XLP_MSIVEC_PER_LINK;8181-}8282-8383-/*8484- * For XLP 8xx/4xx/3xx/2xx, only 32 MSI-X vectors are possible because8585- * there are only 32 PIC interrupts for MSI. We split them statically8686- * and use 8 MSI-X vectors per link - this keeps the allocation and8787- * lookup simple.8888- * On XLP 9xx, there are 32 vectors per link, and the interrupts are8989- * not routed thru PIC, so we can use all 128 MSI-X vectors.9090- */9191-static inline int nlm_link_msixirq(int link, int bit)9292-{9393- return NLM_MSIX_VEC_BASE + link * XLP_MSIXVEC_PER_LINK + bit;9494-}9595-9696-/* get the link MSI vector from irq number */9797-static inline int nlm_irq_msixvec(int irq)9898-{9999- return (irq - NLM_MSIX_VEC_BASE) % XLP_MSIXVEC_TOTAL;100100-}101101-102102-/* get the link from MSIX vec */103103-static inline int nlm_irq_msixlink(int msixvec)104104-{105105- return msixvec / XLP_MSIXVEC_PER_LINK;106106-}107107-108108-/*109109- * Per link MSI and MSI-X information, set as IRQ handler data for110110- * MSI and MSI-X interrupts.111111- */112112-struct xlp_msi_data {113113- struct nlm_soc_info *node;114114- uint64_t lnkbase;115115- uint32_t msi_enabled_mask;116116- uint32_t msi_alloc_mask;117117- uint32_t msix_alloc_mask;118118- spinlock_t msi_lock;119119-};120120-121121-/*122122- * MSI Chip definitions123123- *124124- * On XLP, there is a PIC interrupt associated with each PCIe link on the125125- * chip (which appears as a PCI bridge to us). This gives us 32 MSI irqa126126- * per link and 128 overall.127127- *128128- * When a device connected to the link raises a MSI interrupt, we get a129129- * link interrupt and we then have to look at PCIE_MSI_STATUS register at130130- * the bridge to map it to the IRQ131131- */132132-static void xlp_msi_enable(struct irq_data *d)133133-{134134- struct xlp_msi_data *md = irq_data_get_irq_chip_data(d);135135- unsigned long flags;136136- int vec;137137-138138- vec = nlm_irq_msivec(d->irq);139139- spin_lock_irqsave(&md->msi_lock, flags);140140- md->msi_enabled_mask |= 1u << vec;141141- if (cpu_is_xlp9xx())142142- nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_EN,143143- md->msi_enabled_mask);144144- else145145- nlm_write_reg(md->lnkbase, PCIE_MSI_EN, md->msi_enabled_mask);146146- spin_unlock_irqrestore(&md->msi_lock, flags);147147-}148148-149149-static void xlp_msi_disable(struct irq_data *d)150150-{151151- struct xlp_msi_data *md = irq_data_get_irq_chip_data(d);152152- unsigned long flags;153153- int vec;154154-155155- vec = nlm_irq_msivec(d->irq);156156- spin_lock_irqsave(&md->msi_lock, flags);157157- md->msi_enabled_mask &= ~(1u << vec);158158- if (cpu_is_xlp9xx())159159- nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_EN,160160- md->msi_enabled_mask);161161- else162162- nlm_write_reg(md->lnkbase, PCIE_MSI_EN, md->msi_enabled_mask);163163- spin_unlock_irqrestore(&md->msi_lock, flags);164164-}165165-166166-static void xlp_msi_mask_ack(struct irq_data *d)167167-{168168- struct xlp_msi_data *md = irq_data_get_irq_chip_data(d);169169- int link, vec;170170-171171- link = nlm_irq_msilink(d->irq);172172- vec = nlm_irq_msivec(d->irq);173173- xlp_msi_disable(d);174174-175175- /* Ack MSI on bridge */176176- if (cpu_is_xlp9xx())177177- nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_STATUS, 1u << vec);178178- else179179- nlm_write_reg(md->lnkbase, PCIE_MSI_STATUS, 1u << vec);180180-181181-}182182-183183-static struct irq_chip xlp_msi_chip = {184184- .name = "XLP-MSI",185185- .irq_enable = xlp_msi_enable,186186- .irq_disable = xlp_msi_disable,187187- .irq_mask_ack = xlp_msi_mask_ack,188188- .irq_unmask = xlp_msi_enable,189189-};190190-191191-/*192192- * XLP8XX/4XX/3XX/2XX:193193- * The MSI-X interrupt handling is different from MSI, there are 32 MSI-X194194- * interrupts generated by the PIC and each of these correspond to a MSI-X195195- * vector (0-31) that can be assigned.196196- *197197- * We divide the MSI-X vectors to 8 per link and do a per-link allocation198198- *199199- * XLP9XX:200200- * 32 MSI-X vectors are available per link, and the interrupts are not routed201201- * thru the PIC. PIC ack not needed.202202- *203203- * Enable and disable done using standard MSI functions.204204- */205205-static void xlp_msix_mask_ack(struct irq_data *d)206206-{207207- struct xlp_msi_data *md;208208- int link, msixvec;209209- uint32_t status_reg, bit;210210-211211- msixvec = nlm_irq_msixvec(d->irq);212212- link = nlm_irq_msixlink(msixvec);213213- pci_msi_mask_irq(d);214214- md = irq_data_get_irq_chip_data(d);215215-216216- /* Ack MSI on bridge */217217- if (cpu_is_xlp9xx()) {218218- status_reg = PCIE_9XX_MSIX_STATUSX(link);219219- bit = msixvec % XLP_MSIXVEC_PER_LINK;220220- } else {221221- status_reg = PCIE_MSIX_STATUS;222222- bit = msixvec;223223- }224224- nlm_write_reg(md->lnkbase, status_reg, 1u << bit);225225-226226- if (!cpu_is_xlp9xx())227227- nlm_pic_ack(md->node->picbase,228228- PIC_IRT_PCIE_MSIX_INDEX(msixvec));229229-}230230-231231-static struct irq_chip xlp_msix_chip = {232232- .name = "XLP-MSIX",233233- .irq_enable = pci_msi_unmask_irq,234234- .irq_disable = pci_msi_mask_irq,235235- .irq_mask_ack = xlp_msix_mask_ack,236236- .irq_unmask = pci_msi_unmask_irq,237237-};238238-239239-void arch_teardown_msi_irq(unsigned int irq)240240-{241241-}242242-243243-/*244244- * Setup a PCIe link for MSI. By default, the links are in245245- * legacy interrupt mode. We will switch them to MSI mode246246- * at the first MSI request.247247- */248248-static void xlp_config_link_msi(uint64_t lnkbase, int lirq, uint64_t msiaddr)249249-{250250- u32 val;251251-252252- if (cpu_is_xlp9xx()) {253253- val = nlm_read_reg(lnkbase, PCIE_9XX_INT_EN0);254254- if ((val & 0x200) == 0) {255255- val |= 0x200; /* MSI Interrupt enable */256256- nlm_write_reg(lnkbase, PCIE_9XX_INT_EN0, val);257257- }258258- } else {259259- val = nlm_read_reg(lnkbase, PCIE_INT_EN0);260260- if ((val & 0x200) == 0) {261261- val |= 0x200;262262- nlm_write_reg(lnkbase, PCIE_INT_EN0, val);263263- }264264- }265265-266266- val = nlm_read_reg(lnkbase, 0x1); /* CMD */267267- if ((val & 0x0400) == 0) {268268- val |= 0x0400;269269- nlm_write_reg(lnkbase, 0x1, val);270270- }271271-272272- /* Update IRQ in the PCI irq reg */273273- val = nlm_read_pci_reg(lnkbase, 0xf);274274- val &= ~0x1fu;275275- val |= (1 << 8) | lirq;276276- nlm_write_pci_reg(lnkbase, 0xf, val);277277-278278- /* MSI addr */279279- nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_ADDRH, msiaddr >> 32);280280- nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_ADDRL, msiaddr & 0xffffffff);281281-282282- /* MSI cap for bridge */283283- val = nlm_read_reg(lnkbase, PCIE_BRIDGE_MSI_CAP);284284- if ((val & (1 << 16)) == 0) {285285- val |= 0xb << 16; /* mmc32, msi enable */286286- nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_CAP, val);287287- }288288-}289289-290290-/*291291- * Allocate a MSI vector on a link292292- */293293-static int xlp_setup_msi(uint64_t lnkbase, int node, int link,294294- struct msi_desc *desc)295295-{296296- struct xlp_msi_data *md;297297- struct msi_msg msg;298298- unsigned long flags;299299- int msivec, irt, lirq, xirq, ret;300300- uint64_t msiaddr;301301-302302- /* Get MSI data for the link */303303- lirq = PIC_PCIE_LINK_MSI_IRQ(link);304304- xirq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0));305305- md = irq_get_chip_data(xirq);306306- msiaddr = MSI_LINK_ADDR(node, link);307307-308308- spin_lock_irqsave(&md->msi_lock, flags);309309- if (md->msi_alloc_mask == 0) {310310- xlp_config_link_msi(lnkbase, lirq, msiaddr);311311- /* switch the link IRQ to MSI range */312312- if (cpu_is_xlp9xx())313313- irt = PIC_9XX_IRT_PCIE_LINK_INDEX(link);314314- else315315- irt = PIC_IRT_PCIE_LINK_INDEX(link);316316- nlm_setup_pic_irq(node, lirq, lirq, irt);317317- nlm_pic_init_irt(nlm_get_node(node)->picbase, irt, lirq,318318- node * nlm_threads_per_node(), 1 /*en */);319319- }320320-321321- /* allocate a MSI vec, and tell the bridge about it */322322- msivec = fls(md->msi_alloc_mask);323323- if (msivec == XLP_MSIVEC_PER_LINK) {324324- spin_unlock_irqrestore(&md->msi_lock, flags);325325- return -ENOMEM;326326- }327327- md->msi_alloc_mask |= (1u << msivec);328328- spin_unlock_irqrestore(&md->msi_lock, flags);329329-330330- msg.address_hi = msiaddr >> 32;331331- msg.address_lo = msiaddr & 0xffffffff;332332- msg.data = 0xc00 | msivec;333333-334334- xirq = xirq + msivec; /* msi mapped to global irq space */335335- ret = irq_set_msi_desc(xirq, desc);336336- if (ret < 0)337337- return ret;338338-339339- pci_write_msi_msg(xirq, &msg);340340- return 0;341341-}342342-343343-/*344344- * Switch a link to MSI-X mode345345- */346346-static void xlp_config_link_msix(uint64_t lnkbase, int lirq, uint64_t msixaddr)347347-{348348- u32 val;349349-350350- val = nlm_read_reg(lnkbase, 0x2C);351351- if ((val & 0x80000000U) == 0) {352352- val |= 0x80000000U;353353- nlm_write_reg(lnkbase, 0x2C, val);354354- }355355-356356- if (cpu_is_xlp9xx()) {357357- val = nlm_read_reg(lnkbase, PCIE_9XX_INT_EN0);358358- if ((val & 0x200) == 0) {359359- val |= 0x200; /* MSI Interrupt enable */360360- nlm_write_reg(lnkbase, PCIE_9XX_INT_EN0, val);361361- }362362- } else {363363- val = nlm_read_reg(lnkbase, PCIE_INT_EN0);364364- if ((val & 0x200) == 0) {365365- val |= 0x200; /* MSI Interrupt enable */366366- nlm_write_reg(lnkbase, PCIE_INT_EN0, val);367367- }368368- }369369-370370- val = nlm_read_reg(lnkbase, 0x1); /* CMD */371371- if ((val & 0x0400) == 0) {372372- val |= 0x0400;373373- nlm_write_reg(lnkbase, 0x1, val);374374- }375375-376376- /* Update IRQ in the PCI irq reg */377377- val = nlm_read_pci_reg(lnkbase, 0xf);378378- val &= ~0x1fu;379379- val |= (1 << 8) | lirq;380380- nlm_write_pci_reg(lnkbase, 0xf, val);381381-382382- if (cpu_is_xlp9xx()) {383383- /* MSI-X addresses */384384- nlm_write_reg(lnkbase, PCIE_9XX_BRIDGE_MSIX_ADDR_BASE,385385- msixaddr >> 8);386386- nlm_write_reg(lnkbase, PCIE_9XX_BRIDGE_MSIX_ADDR_LIMIT,387387- (msixaddr + MSI_ADDR_SZ) >> 8);388388- } else {389389- /* MSI-X addresses */390390- nlm_write_reg(lnkbase, PCIE_BRIDGE_MSIX_ADDR_BASE,391391- msixaddr >> 8);392392- nlm_write_reg(lnkbase, PCIE_BRIDGE_MSIX_ADDR_LIMIT,393393- (msixaddr + MSI_ADDR_SZ) >> 8);394394- }395395-}396396-397397-/*398398- * Allocate a MSI-X vector399399- */400400-static int xlp_setup_msix(uint64_t lnkbase, int node, int link,401401- struct msi_desc *desc)402402-{403403- struct xlp_msi_data *md;404404- struct msi_msg msg;405405- unsigned long flags;406406- int t, msixvec, lirq, xirq, ret;407407- uint64_t msixaddr;408408-409409- /* Get MSI data for the link */410410- lirq = PIC_PCIE_MSIX_IRQ(link);411411- xirq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0));412412- md = irq_get_chip_data(xirq);413413- msixaddr = MSIX_LINK_ADDR(node, link);414414-415415- spin_lock_irqsave(&md->msi_lock, flags);416416- /* switch the PCIe link to MSI-X mode at the first alloc */417417- if (md->msix_alloc_mask == 0)418418- xlp_config_link_msix(lnkbase, lirq, msixaddr);419419-420420- /* allocate a MSI-X vec, and tell the bridge about it */421421- t = fls(md->msix_alloc_mask);422422- if (t == XLP_MSIXVEC_PER_LINK) {423423- spin_unlock_irqrestore(&md->msi_lock, flags);424424- return -ENOMEM;425425- }426426- md->msix_alloc_mask |= (1u << t);427427- spin_unlock_irqrestore(&md->msi_lock, flags);428428-429429- xirq += t;430430- msixvec = nlm_irq_msixvec(xirq);431431-432432- msg.address_hi = msixaddr >> 32;433433- msg.address_lo = msixaddr & 0xffffffff;434434- msg.data = 0xc00 | msixvec;435435-436436- ret = irq_set_msi_desc(xirq, desc);437437- if (ret < 0)438438- return ret;439439-440440- pci_write_msi_msg(xirq, &msg);441441- return 0;442442-}443443-444444-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)445445-{446446- struct pci_dev *lnkdev;447447- uint64_t lnkbase;448448- int node, link, slot;449449-450450- lnkdev = xlp_get_pcie_link(dev);451451- if (lnkdev == NULL) {452452- dev_err(&dev->dev, "Could not find bridge\n");453453- return 1;454454- }455455- slot = PCI_SLOT(lnkdev->devfn);456456- link = PCI_FUNC(lnkdev->devfn);457457- node = slot / 8;458458- lnkbase = nlm_get_pcie_base(node, link);459459-460460- if (desc->msi_attrib.is_msix)461461- return xlp_setup_msix(lnkbase, node, link, desc);462462- else463463- return xlp_setup_msi(lnkbase, node, link, desc);464464-}465465-466466-void __init xlp_init_node_msi_irqs(int node, int link)467467-{468468- struct nlm_soc_info *nodep;469469- struct xlp_msi_data *md;470470- int irq, i, irt, msixvec, val;471471-472472- pr_info("[%d %d] Init node PCI IRT\n", node, link);473473- nodep = nlm_get_node(node);474474-475475- /* Alloc an MSI block for the link */476476- md = kzalloc(sizeof(*md), GFP_KERNEL);477477- spin_lock_init(&md->msi_lock);478478- md->msi_enabled_mask = 0;479479- md->msi_alloc_mask = 0;480480- md->msix_alloc_mask = 0;481481- md->node = nodep;482482- md->lnkbase = nlm_get_pcie_base(node, link);483483-484484- /* extended space for MSI interrupts */485485- irq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0));486486- for (i = irq; i < irq + XLP_MSIVEC_PER_LINK; i++) {487487- irq_set_chip_and_handler(i, &xlp_msi_chip, handle_level_irq);488488- irq_set_chip_data(i, md);489489- }490490-491491- for (i = 0; i < XLP_MSIXVEC_PER_LINK ; i++) {492492- if (cpu_is_xlp9xx()) {493493- val = ((node * nlm_threads_per_node()) << 7 |494494- PIC_PCIE_MSIX_IRQ(link) << 1 | 0 << 0);495495- nlm_write_pcie_reg(md->lnkbase, PCIE_9XX_MSIX_VECX(i +496496- (link * XLP_MSIXVEC_PER_LINK)), val);497497- } else {498498- /* Initialize MSI-X irts to generate one interrupt499499- * per link500500- */501501- msixvec = link * XLP_MSIXVEC_PER_LINK + i;502502- irt = PIC_IRT_PCIE_MSIX_INDEX(msixvec);503503- nlm_pic_init_irt(nodep->picbase, irt,504504- PIC_PCIE_MSIX_IRQ(link),505505- node * nlm_threads_per_node(), 1);506506- }507507-508508- /* Initialize MSI-X extended irq space for the link */509509- irq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, i));510510- irq_set_chip_and_handler(irq, &xlp_msix_chip, handle_level_irq);511511- irq_set_chip_data(irq, md);512512- }513513-}514514-515515-void nlm_dispatch_msi(int node, int lirq)516516-{517517- struct xlp_msi_data *md;518518- int link, i, irqbase;519519- u32 status;520520-521521- link = lirq - PIC_PCIE_LINK_MSI_IRQ_BASE;522522- irqbase = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0));523523- md = irq_get_chip_data(irqbase);524524- if (cpu_is_xlp9xx())525525- status = nlm_read_reg(md->lnkbase, PCIE_9XX_MSI_STATUS) &526526- md->msi_enabled_mask;527527- else528528- status = nlm_read_reg(md->lnkbase, PCIE_MSI_STATUS) &529529- md->msi_enabled_mask;530530- while (status) {531531- i = __ffs(status);532532- do_IRQ(irqbase + i);533533- status &= status - 1;534534- }535535-536536- /* Ack at eirr and PIC */537537- ack_c0_eirr(PIC_PCIE_LINK_MSI_IRQ(link));538538- if (cpu_is_xlp9xx())539539- nlm_pic_ack(md->node->picbase,540540- PIC_9XX_IRT_PCIE_LINK_INDEX(link));541541- else542542- nlm_pic_ack(md->node->picbase, PIC_IRT_PCIE_LINK_INDEX(link));543543-}544544-545545-void nlm_dispatch_msix(int node, int lirq)546546-{547547- struct xlp_msi_data *md;548548- int link, i, irqbase;549549- u32 status;550550-551551- link = lirq - PIC_PCIE_MSIX_IRQ_BASE;552552- irqbase = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0));553553- md = irq_get_chip_data(irqbase);554554- if (cpu_is_xlp9xx())555555- status = nlm_read_reg(md->lnkbase, PCIE_9XX_MSIX_STATUSX(link));556556- else557557- status = nlm_read_reg(md->lnkbase, PCIE_MSIX_STATUS);558558-559559- /* narrow it down to the MSI-x vectors for our link */560560- if (!cpu_is_xlp9xx())561561- status = (status >> (link * XLP_MSIXVEC_PER_LINK)) &562562- ((1 << XLP_MSIXVEC_PER_LINK) - 1);563563-564564- while (status) {565565- i = __ffs(status);566566- do_IRQ(irqbase + i);567567- status &= status - 1;568568- }569569- /* Ack at eirr and PIC */570570- ack_c0_eirr(PIC_PCIE_MSIX_IRQ(link));571571-}
-332
arch/mips/pci/pci-xlp.c
···11-/*22- * Copyright (c) 2003-2012 Broadcom Corporation33- * All Rights Reserved44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the Broadcom99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/types.h>3636-#include <linux/pci.h>3737-#include <linux/kernel.h>3838-#include <linux/init.h>3939-#include <linux/msi.h>4040-#include <linux/mm.h>4141-#include <linux/irq.h>4242-#include <linux/irqdesc.h>4343-#include <linux/console.h>4444-4545-#include <asm/io.h>4646-4747-#include <asm/netlogic/interrupt.h>4848-#include <asm/netlogic/haldefs.h>4949-#include <asm/netlogic/common.h>5050-#include <asm/netlogic/mips-extns.h>5151-5252-#include <asm/netlogic/xlp-hal/iomap.h>5353-#include <asm/netlogic/xlp-hal/xlp.h>5454-#include <asm/netlogic/xlp-hal/pic.h>5555-#include <asm/netlogic/xlp-hal/pcibus.h>5656-#include <asm/netlogic/xlp-hal/bridge.h>5757-5858-static void *pci_config_base;5959-6060-#define pci_cfg_addr(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))6161-6262-/* PCI ops */6363-static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn,6464- int where)6565-{6666- u32 data;6767- u32 *cfgaddr;6868-6969- where &= ~3;7070- if (cpu_is_xlp9xx()) {7171- /* be very careful on SoC buses */7272- if (bus->number == 0) {7373- /* Scan only existing nodes - uboot bug? */7474- if (PCI_SLOT(devfn) != 0 ||7575- !nlm_node_present(PCI_FUNC(devfn)))7676- return 0xffffffff;7777- } else if (bus->parent->number == 0) { /* SoC bus */7878- if (PCI_SLOT(devfn) == 0) /* b.0.0 hangs */7979- return 0xffffffff;8080- if (devfn == 44) /* b.5.4 hangs */8181- return 0xffffffff;8282- }8383- } else if (bus->number == 0 && PCI_SLOT(devfn) == 1 && where == 0x954) {8484- return 0xffffffff;8585- }8686- cfgaddr = (u32 *)(pci_config_base +8787- pci_cfg_addr(bus->number, devfn, where));8888- data = *cfgaddr;8989- return data;9090-}9191-9292-static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn,9393- int where, u32 data)9494-{9595- u32 *cfgaddr;9696-9797- cfgaddr = (u32 *)(pci_config_base +9898- pci_cfg_addr(bus->number, devfn, where & ~3));9999- *cfgaddr = data;100100-}101101-102102-static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn,103103- int where, int size, u32 *val)104104-{105105- u32 data;106106-107107- if ((size == 2) && (where & 1))108108- return PCIBIOS_BAD_REGISTER_NUMBER;109109- else if ((size == 4) && (where & 3))110110- return PCIBIOS_BAD_REGISTER_NUMBER;111111-112112- data = pci_cfg_read_32bit(bus, devfn, where);113113-114114- if (size == 1)115115- *val = (data >> ((where & 3) << 3)) & 0xff;116116- else if (size == 2)117117- *val = (data >> ((where & 3) << 3)) & 0xffff;118118- else119119- *val = data;120120-121121- return PCIBIOS_SUCCESSFUL;122122-}123123-124124-125125-static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn,126126- int where, int size, u32 val)127127-{128128- u32 data;129129-130130- if ((size == 2) && (where & 1))131131- return PCIBIOS_BAD_REGISTER_NUMBER;132132- else if ((size == 4) && (where & 3))133133- return PCIBIOS_BAD_REGISTER_NUMBER;134134-135135- data = pci_cfg_read_32bit(bus, devfn, where);136136-137137- if (size == 1)138138- data = (data & ~(0xff << ((where & 3) << 3))) |139139- (val << ((where & 3) << 3));140140- else if (size == 2)141141- data = (data & ~(0xffff << ((where & 3) << 3))) |142142- (val << ((where & 3) << 3));143143- else144144- data = val;145145-146146- pci_cfg_write_32bit(bus, devfn, where, data);147147-148148- return PCIBIOS_SUCCESSFUL;149149-}150150-151151-struct pci_ops nlm_pci_ops = {152152- .read = nlm_pcibios_read,153153- .write = nlm_pcibios_write154154-};155155-156156-static struct resource nlm_pci_mem_resource = {157157- .name = "XLP PCI MEM",158158- .start = 0xd0000000UL, /* 256MB PCI mem @ 0xd000_0000 */159159- .end = 0xdfffffffUL,160160- .flags = IORESOURCE_MEM,161161-};162162-163163-static struct resource nlm_pci_io_resource = {164164- .name = "XLP IO MEM",165165- .start = 0x14000000UL, /* 64MB PCI IO @ 0x1000_0000 */166166- .end = 0x17ffffffUL,167167- .flags = IORESOURCE_IO,168168-};169169-170170-struct pci_controller nlm_pci_controller = {171171- .index = 0,172172- .pci_ops = &nlm_pci_ops,173173- .mem_resource = &nlm_pci_mem_resource,174174- .mem_offset = 0x00000000UL,175175- .io_resource = &nlm_pci_io_resource,176176- .io_offset = 0x00000000UL,177177-};178178-179179-struct pci_dev *xlp_get_pcie_link(const struct pci_dev *dev)180180-{181181- struct pci_bus *bus, *p;182182-183183- bus = dev->bus;184184-185185- if (cpu_is_xlp9xx()) {186186- /* find bus with grand parent number == 0 */187187- for (p = bus->parent; p && p->parent && p->parent->number != 0;188188- p = p->parent)189189- bus = p;190190- return (p && p->parent) ? bus->self : NULL;191191- } else {192192- /* Find the bridge on bus 0 */193193- for (p = bus->parent; p && p->number != 0; p = p->parent)194194- bus = p;195195-196196- return p ? bus->self : NULL;197197- }198198-}199199-200200-int xlp_socdev_to_node(const struct pci_dev *lnkdev)201201-{202202- if (cpu_is_xlp9xx())203203- return PCI_FUNC(lnkdev->bus->self->devfn);204204- else205205- return PCI_SLOT(lnkdev->devfn) / 8;206206-}207207-208208-int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)209209-{210210- struct pci_dev *lnkdev;211211- int lnkfunc, node;212212-213213- /*214214- * For XLP PCIe, there is an IRQ per Link, find out which215215- * link the device is on to assign interrupts216216- */217217- lnkdev = xlp_get_pcie_link(dev);218218- if (lnkdev == NULL)219219- return 0;220220-221221- lnkfunc = PCI_FUNC(lnkdev->devfn);222222- node = xlp_socdev_to_node(lnkdev);223223-224224- return nlm_irq_to_xirq(node, PIC_PCIE_LINK_LEGACY_IRQ(lnkfunc));225225-}226226-227227-/* Do platform specific device initialization at pci_enable_device() time */228228-int pcibios_plat_dev_init(struct pci_dev *dev)229229-{230230- return 0;231231-}232232-233233-/*234234- * If big-endian, enable hardware byteswap on the PCIe bridges.235235- * This will make both the SoC and PCIe devices behave consistently with236236- * readl/writel.237237- */238238-#ifdef __BIG_ENDIAN239239-static void xlp_config_pci_bswap(int node, int link)240240-{241241- uint64_t nbubase, lnkbase;242242- u32 reg;243243-244244- nbubase = nlm_get_bridge_regbase(node);245245- lnkbase = nlm_get_pcie_base(node, link);246246-247247- /*248248- * Enable byte swap in hardware. Program each link's PCIe SWAP regions249249- * from the link's address ranges.250250- */251251- if (cpu_is_xlp9xx()) {252252- reg = nlm_read_bridge_reg(nbubase,253253- BRIDGE_9XX_PCIEMEM_BASE0 + link);254254- nlm_write_pci_reg(lnkbase, PCIE_9XX_BYTE_SWAP_MEM_BASE, reg);255255-256256- reg = nlm_read_bridge_reg(nbubase,257257- BRIDGE_9XX_PCIEMEM_LIMIT0 + link);258258- nlm_write_pci_reg(lnkbase,259259- PCIE_9XX_BYTE_SWAP_MEM_LIM, reg | 0xfff);260260-261261- reg = nlm_read_bridge_reg(nbubase,262262- BRIDGE_9XX_PCIEIO_BASE0 + link);263263- nlm_write_pci_reg(lnkbase, PCIE_9XX_BYTE_SWAP_IO_BASE, reg);264264-265265- reg = nlm_read_bridge_reg(nbubase,266266- BRIDGE_9XX_PCIEIO_LIMIT0 + link);267267- nlm_write_pci_reg(lnkbase,268268- PCIE_9XX_BYTE_SWAP_IO_LIM, reg | 0xfff);269269- } else {270270- reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEMEM_BASE0 + link);271271- nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_MEM_BASE, reg);272272-273273- reg = nlm_read_bridge_reg(nbubase,274274- BRIDGE_PCIEMEM_LIMIT0 + link);275275- nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_MEM_LIM, reg | 0xfff);276276-277277- reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_BASE0 + link);278278- nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_IO_BASE, reg);279279-280280- reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_LIMIT0 + link);281281- nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_IO_LIM, reg | 0xfff);282282- }283283-}284284-#else285285-/* Swap configuration not needed in little-endian mode */286286-static inline void xlp_config_pci_bswap(int node, int link) {}287287-#endif /* __BIG_ENDIAN */288288-289289-static int __init pcibios_init(void)290290-{291291- uint64_t pciebase;292292- int link, n;293293- u32 reg;294294-295295- /* Firmware assigns PCI resources */296296- pci_set_flags(PCI_PROBE_ONLY);297297- pci_config_base = ioremap(XLP_DEFAULT_PCI_ECFG_BASE, 64 << 20);298298-299299- /* Extend IO port for memory mapped io */300300- ioport_resource.start = 0;301301- ioport_resource.end = ~0;302302-303303- for (n = 0; n < NLM_NR_NODES; n++) {304304- if (!nlm_node_present(n))305305- continue;306306-307307- for (link = 0; link < PCIE_NLINKS; link++) {308308- pciebase = nlm_get_pcie_base(n, link);309309- if (nlm_read_pci_reg(pciebase, 0) == 0xffffffff)310310- continue;311311- xlp_config_pci_bswap(n, link);312312- xlp_init_node_msi_irqs(n, link);313313-314314- /* put in intpin and irq - u-boot does not */315315- reg = nlm_read_pci_reg(pciebase, 0xf);316316- reg &= ~0x1ffu;317317- reg |= (1 << 8) | PIC_PCIE_LINK_LEGACY_IRQ(link);318318- nlm_write_pci_reg(pciebase, 0xf, reg);319319- pr_info("XLP PCIe: Link %d-%d initialized.\n", n, link);320320- }321321- }322322-323323- set_io_port_base(CKSEG1);324324- nlm_pci_controller.io_map_base = CKSEG1;325325-326326- register_pci_controller(&nlm_pci_controller);327327- pr_info("XLP PCIe Controller %pR%pR.\n", &nlm_pci_io_resource,328328- &nlm_pci_mem_resource);329329-330330- return 0;331331-}332332-arch_initcall(pcibios_init);
-368
arch/mips/pci/pci-xlr.c
···11-/*22- * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights33- * reserved.44- *55- * This software is available to you under a choice of one of two66- * licenses. You may choose to be licensed under the terms of the GNU77- * General Public License (GPL) Version 2, available from the file88- * COPYING in the main directory of this source tree, or the NetLogic99- * license below:1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- *1515- * 1. Redistributions of source code must retain the above copyright1616- * notice, this list of conditions and the following disclaimer.1717- * 2. Redistributions in binary form must reproduce the above copyright1818- * notice, this list of conditions and the following disclaimer in1919- * the documentation and/or other materials provided with the2020- * distribution.2121- *2222- * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR2323- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2424- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE2525- * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE2626- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR2727- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF2828- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR2929- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,3030- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE3131- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN3232- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333- */3434-3535-#include <linux/types.h>3636-#include <linux/pci.h>3737-#include <linux/kernel.h>3838-#include <linux/init.h>3939-#include <linux/msi.h>4040-#include <linux/mm.h>4141-#include <linux/irq.h>4242-#include <linux/irqdesc.h>4343-#include <linux/console.h>4444-#include <linux/pci_regs.h>4545-4646-#include <asm/io.h>4747-4848-#include <asm/netlogic/interrupt.h>4949-#include <asm/netlogic/haldefs.h>5050-#include <asm/netlogic/common.h>5151-5252-#include <asm/netlogic/xlr/msidef.h>5353-#include <asm/netlogic/xlr/iomap.h>5454-#include <asm/netlogic/xlr/pic.h>5555-#include <asm/netlogic/xlr/xlr.h>5656-5757-static void *pci_config_base;5858-5959-#define pci_cfg_addr(bus, devfn, off) (((bus) << 16) | ((devfn) << 8) | (off))6060-6161-/* PCI ops */6262-static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn,6363- int where)6464-{6565- u32 data;6666- u32 *cfgaddr;6767-6868- cfgaddr = (u32 *)(pci_config_base +6969- pci_cfg_addr(bus->number, devfn, where & ~3));7070- data = *cfgaddr;7171- return cpu_to_le32(data);7272-}7373-7474-static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn,7575- int where, u32 data)7676-{7777- u32 *cfgaddr;7878-7979- cfgaddr = (u32 *)(pci_config_base +8080- pci_cfg_addr(bus->number, devfn, where & ~3));8181- *cfgaddr = cpu_to_le32(data);8282-}8383-8484-static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn,8585- int where, int size, u32 *val)8686-{8787- u32 data;8888-8989- if ((size == 2) && (where & 1))9090- return PCIBIOS_BAD_REGISTER_NUMBER;9191- else if ((size == 4) && (where & 3))9292- return PCIBIOS_BAD_REGISTER_NUMBER;9393-9494- data = pci_cfg_read_32bit(bus, devfn, where);9595-9696- if (size == 1)9797- *val = (data >> ((where & 3) << 3)) & 0xff;9898- else if (size == 2)9999- *val = (data >> ((where & 3) << 3)) & 0xffff;100100- else101101- *val = data;102102-103103- return PCIBIOS_SUCCESSFUL;104104-}105105-106106-107107-static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn,108108- int where, int size, u32 val)109109-{110110- u32 data;111111-112112- if ((size == 2) && (where & 1))113113- return PCIBIOS_BAD_REGISTER_NUMBER;114114- else if ((size == 4) && (where & 3))115115- return PCIBIOS_BAD_REGISTER_NUMBER;116116-117117- data = pci_cfg_read_32bit(bus, devfn, where);118118-119119- if (size == 1)120120- data = (data & ~(0xff << ((where & 3) << 3))) |121121- (val << ((where & 3) << 3));122122- else if (size == 2)123123- data = (data & ~(0xffff << ((where & 3) << 3))) |124124- (val << ((where & 3) << 3));125125- else126126- data = val;127127-128128- pci_cfg_write_32bit(bus, devfn, where, data);129129-130130- return PCIBIOS_SUCCESSFUL;131131-}132132-133133-struct pci_ops nlm_pci_ops = {134134- .read = nlm_pcibios_read,135135- .write = nlm_pcibios_write136136-};137137-138138-static struct resource nlm_pci_mem_resource = {139139- .name = "XLR PCI MEM",140140- .start = 0xd0000000UL, /* 256MB PCI mem @ 0xd000_0000 */141141- .end = 0xdfffffffUL,142142- .flags = IORESOURCE_MEM,143143-};144144-145145-static struct resource nlm_pci_io_resource = {146146- .name = "XLR IO MEM",147147- .start = 0x10000000UL, /* 16MB PCI IO @ 0x1000_0000 */148148- .end = 0x100fffffUL,149149- .flags = IORESOURCE_IO,150150-};151151-152152-struct pci_controller nlm_pci_controller = {153153- .index = 0,154154- .pci_ops = &nlm_pci_ops,155155- .mem_resource = &nlm_pci_mem_resource,156156- .mem_offset = 0x00000000UL,157157- .io_resource = &nlm_pci_io_resource,158158- .io_offset = 0x00000000UL,159159-};160160-161161-/*162162- * The top level PCIe links on the XLS PCIe controller appear as163163- * bridges. Given a device, this function finds which link it is164164- * on.165165- */166166-static struct pci_dev *xls_get_pcie_link(const struct pci_dev *dev)167167-{168168- struct pci_bus *bus, *p;169169-170170- /* Find the bridge on bus 0 */171171- bus = dev->bus;172172- for (p = bus->parent; p && p->number != 0; p = p->parent)173173- bus = p;174174-175175- return p ? bus->self : NULL;176176-}177177-178178-static int nlm_pci_link_to_irq(int link)179179-{180180- switch (link) {181181- case 0:182182- return PIC_PCIE_LINK0_IRQ;183183- case 1:184184- return PIC_PCIE_LINK1_IRQ;185185- case 2:186186- if (nlm_chip_is_xls_b())187187- return PIC_PCIE_XLSB0_LINK2_IRQ;188188- else189189- return PIC_PCIE_LINK2_IRQ;190190- case 3:191191- if (nlm_chip_is_xls_b())192192- return PIC_PCIE_XLSB0_LINK3_IRQ;193193- else194194- return PIC_PCIE_LINK3_IRQ;195195- }196196- WARN(1, "Unexpected link %d\n", link);197197- return 0;198198-}199199-200200-static int get_irq_vector(const struct pci_dev *dev)201201-{202202- struct pci_dev *lnk;203203- int link;204204-205205- if (!nlm_chip_is_xls())206206- return PIC_PCIX_IRQ; /* for XLR just one IRQ */207207-208208- lnk = xls_get_pcie_link(dev);209209- if (lnk == NULL)210210- return 0;211211-212212- link = PCI_SLOT(lnk->devfn);213213- return nlm_pci_link_to_irq(link);214214-}215215-216216-#ifdef CONFIG_PCI_MSI217217-void arch_teardown_msi_irq(unsigned int irq)218218-{219219-}220220-221221-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)222222-{223223- struct msi_msg msg;224224- struct pci_dev *lnk;225225- int irq, ret;226226- u16 val;227227-228228- /* MSI not supported on XLR */229229- if (!nlm_chip_is_xls())230230- return 1;231231-232232- /*233233- * Enable MSI on the XLS PCIe controller bridge which was disabled234234- * at enumeration, the bridge MSI capability is at 0x50235235- */236236- lnk = xls_get_pcie_link(dev);237237- if (lnk == NULL)238238- return 1;239239-240240- pci_read_config_word(lnk, 0x50 + PCI_MSI_FLAGS, &val);241241- if ((val & PCI_MSI_FLAGS_ENABLE) == 0) {242242- val |= PCI_MSI_FLAGS_ENABLE;243243- pci_write_config_word(lnk, 0x50 + PCI_MSI_FLAGS, val);244244- }245245-246246- irq = get_irq_vector(dev);247247- if (irq <= 0)248248- return 1;249249-250250- msg.address_hi = MSI_ADDR_BASE_HI;251251- msg.address_lo = MSI_ADDR_BASE_LO |252252- MSI_ADDR_DEST_MODE_PHYSICAL |253253- MSI_ADDR_REDIRECTION_CPU;254254-255255- msg.data = MSI_DATA_TRIGGER_EDGE |256256- MSI_DATA_LEVEL_ASSERT |257257- MSI_DATA_DELIVERY_FIXED;258258-259259- ret = irq_set_msi_desc(irq, desc);260260- if (ret < 0)261261- return ret;262262-263263- pci_write_msi_msg(irq, &msg);264264- return 0;265265-}266266-#endif267267-268268-/* Extra ACK needed for XLR on chip PCI controller */269269-static void xlr_pci_ack(struct irq_data *d)270270-{271271- uint64_t pcibase = nlm_mmio_base(NETLOGIC_IO_PCIX_OFFSET);272272-273273- nlm_read_reg(pcibase, (0x140 >> 2));274274-}275275-276276-/* Extra ACK needed for XLS on chip PCIe controller */277277-static void xls_pcie_ack(struct irq_data *d)278278-{279279- uint64_t pciebase_le = nlm_mmio_base(NETLOGIC_IO_PCIE_1_OFFSET);280280-281281- switch (d->irq) {282282- case PIC_PCIE_LINK0_IRQ:283283- nlm_write_reg(pciebase_le, (0x90 >> 2), 0xffffffff);284284- break;285285- case PIC_PCIE_LINK1_IRQ:286286- nlm_write_reg(pciebase_le, (0x94 >> 2), 0xffffffff);287287- break;288288- case PIC_PCIE_LINK2_IRQ:289289- nlm_write_reg(pciebase_le, (0x190 >> 2), 0xffffffff);290290- break;291291- case PIC_PCIE_LINK3_IRQ:292292- nlm_write_reg(pciebase_le, (0x194 >> 2), 0xffffffff);293293- break;294294- }295295-}296296-297297-/* For XLS B silicon, the 3,4 PCI interrupts are different */298298-static void xls_pcie_ack_b(struct irq_data *d)299299-{300300- uint64_t pciebase_le = nlm_mmio_base(NETLOGIC_IO_PCIE_1_OFFSET);301301-302302- switch (d->irq) {303303- case PIC_PCIE_LINK0_IRQ:304304- nlm_write_reg(pciebase_le, (0x90 >> 2), 0xffffffff);305305- break;306306- case PIC_PCIE_LINK1_IRQ:307307- nlm_write_reg(pciebase_le, (0x94 >> 2), 0xffffffff);308308- break;309309- case PIC_PCIE_XLSB0_LINK2_IRQ:310310- nlm_write_reg(pciebase_le, (0x190 >> 2), 0xffffffff);311311- break;312312- case PIC_PCIE_XLSB0_LINK3_IRQ:313313- nlm_write_reg(pciebase_le, (0x194 >> 2), 0xffffffff);314314- break;315315- }316316-}317317-318318-int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)319319-{320320- return get_irq_vector(dev);321321-}322322-323323-/* Do platform specific device initialization at pci_enable_device() time */324324-int pcibios_plat_dev_init(struct pci_dev *dev)325325-{326326- return 0;327327-}328328-329329-static int __init pcibios_init(void)330330-{331331- void (*extra_ack)(struct irq_data *);332332- int link, irq;333333-334334- /* PSB assigns PCI resources */335335- pci_set_flags(PCI_PROBE_ONLY);336336- pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20);337337-338338- /* Extend IO port for memory mapped io */339339- ioport_resource.start = 0;340340- ioport_resource.end = ~0;341341-342342- set_io_port_base(CKSEG1);343343- nlm_pci_controller.io_map_base = CKSEG1;344344-345345- pr_info("Registering XLR/XLS PCIX/PCIE Controller.\n");346346- register_pci_controller(&nlm_pci_controller);347347-348348- /*349349- * For PCI interrupts, we need to ack the PCI controller too, overload350350- * irq handler data to do this351351- */352352- if (!nlm_chip_is_xls()) {353353- /* XLR PCI controller ACK */354354- nlm_set_pic_extra_ack(0, PIC_PCIX_IRQ, xlr_pci_ack);355355- } else {356356- if (nlm_chip_is_xls_b())357357- extra_ack = xls_pcie_ack_b;358358- else359359- extra_ack = xls_pcie_ack;360360- for (link = 0; link < 4; link++) {361361- irq = nlm_pci_link_to_irq(link);362362- nlm_set_pic_extra_ack(0, irq, extra_ack);363363- }364364- }365365- return 0;366366-}367367-368368-arch_initcall(pcibios_init);