From owner-svn-src-all@freebsd.org Thu Jul 14 17:10:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC3DDB99FF5; Thu, 14 Jul 2016 17:10:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEFF51EB1; Thu, 14 Jul 2016 17:10:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6EHAs0Q003312; Thu, 14 Jul 2016 17:10:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6EHAsfM003310; Thu, 14 Jul 2016 17:10:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607141710.u6EHAsfM003310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 14 Jul 2016 17:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302849 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 17:10:56 -0000 Author: andrew Date: Thu Jul 14 17:10:54 2016 New Revision: 302849 URL: https://svnweb.freebsd.org/changeset/base/302849 Log: Move structures only used by the GICv3 ITS driver from a shared header to the ITS driver file. There is no need for other drivers to need to know about these structures. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu Jul 14 17:05:25 2016 (r302848) +++ head/sys/arm64/arm64/gic_v3_var.h Thu Jul 14 17:10:54 2016 (r302849) @@ -108,87 +108,6 @@ void gic_r_write_4(device_t, bus_size_t, void gic_r_write_8(device_t, bus_size_t, uint64_t var); /* - * ITS - */ - -/* LPI chunk owned by ITS device */ -struct lpi_chunk { - u_int lpi_base; - u_int lpi_free; /* First free LPI in set */ - u_int lpi_num; /* Total number of LPIs in chunk */ - u_int lpi_busy; /* Number of busy LPIs in chink */ -}; - -/* ITS device */ -struct its_dev { - TAILQ_ENTRY(its_dev) entry; - /* PCI device */ - device_t pci_dev; - /* Device ID (i.e. PCI device ID) */ - uint32_t devid; - /* List of assigned LPIs */ - struct lpi_chunk lpis; - /* Virtual address of ITT */ - vm_offset_t itt; - size_t itt_size; -}; - -/* - * ITS command descriptor. - * Idea for command description passing taken from Linux. - */ -struct its_cmd_desc { - uint8_t cmd_type; - - union { - struct { - struct its_dev *its_dev; - struct its_col *col; - uint32_t id; - } cmd_desc_movi; - - struct { - struct its_col *col; - } cmd_desc_sync; - - struct { - struct its_col *col; - uint8_t valid; - } cmd_desc_mapc; - - struct { - struct its_dev *its_dev; - struct its_col *col; - uint32_t pid; - uint32_t id; - } cmd_desc_mapvi; - - struct { - struct its_dev *its_dev; - struct its_col *col; - uint32_t pid; - } cmd_desc_mapi; - - struct { - struct its_dev *its_dev; - uint8_t valid; - } cmd_desc_mapd; - - struct { - struct its_dev *its_dev; - struct its_col *col; - uint32_t pid; - } cmd_desc_inv; - - struct { - struct its_col *col; - } cmd_desc_invall; - }; -}; - -#define ITS_TARGET_NONE 0xFBADBEEF - -/* * GIC Distributor accessors. * Notice that only GIC sofc can be passed. */ Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu Jul 14 17:05:25 2016 (r302848) +++ head/sys/arm64/arm64/gicv3_its.c Thu Jul 14 17:10:54 2016 (r302849) @@ -123,6 +123,83 @@ MALLOC_DEFINE(M_GICV3_ITS, "GICv3 ITS", #define CMD_VALID_SHIFT (63) #define CMD_VALID_MASK (1UL << CMD_VALID_SHIFT) +#define ITS_TARGET_NONE 0xFBADBEEF + +/* LPI chunk owned by ITS device */ +struct lpi_chunk { + u_int lpi_base; + u_int lpi_free; /* First free LPI in set */ + u_int lpi_num; /* Total number of LPIs in chunk */ + u_int lpi_busy; /* Number of busy LPIs in chink */ +}; + +/* ITS device */ +struct its_dev { + TAILQ_ENTRY(its_dev) entry; + /* PCI device */ + device_t pci_dev; + /* Device ID (i.e. PCI device ID) */ + uint32_t devid; + /* List of assigned LPIs */ + struct lpi_chunk lpis; + /* Virtual address of ITT */ + vm_offset_t itt; + size_t itt_size; +}; + +/* + * ITS command descriptor. + * Idea for command description passing taken from Linux. + */ +struct its_cmd_desc { + uint8_t cmd_type; + + union { + struct { + struct its_dev *its_dev; + struct its_col *col; + uint32_t id; + } cmd_desc_movi; + + struct { + struct its_col *col; + } cmd_desc_sync; + + struct { + struct its_col *col; + uint8_t valid; + } cmd_desc_mapc; + + struct { + struct its_dev *its_dev; + struct its_col *col; + uint32_t pid; + uint32_t id; + } cmd_desc_mapvi; + + struct { + struct its_dev *its_dev; + struct its_col *col; + uint32_t pid; + } cmd_desc_mapi; + + struct { + struct its_dev *its_dev; + uint8_t valid; + } cmd_desc_mapd; + + struct { + struct its_dev *its_dev; + struct its_col *col; + uint32_t pid; + } cmd_desc_inv; + + struct { + struct its_col *col; + } cmd_desc_invall; + }; +}; + /* ITS command. Each command is 32 bytes long */ struct its_cmd { uint64_t cmd_dword[4]; /* ITS command double word */