menuconfig HIPCIE
	bool "Hisilicon PCI Express support"
	depends on PCI && (ARCH_HI3519 || ARCH_HI3519V101 || ARCH_HI3559 || ARCH_HI3531D || ARCH_HI3556 || ARCH_HI3516AV200)
	default y if PCI
	default n if !PCI
	help
	Hisilicon PCI Express support
	Choose this selection to support PCI Express uses.

if HIPCIE

menu "PCI Express configs"

config PCIE0_SEL
        int "PCI Express controller 0 sel"
        range 0 1
        default "0" if !PCI
        default "1" if PCI
        depends on PCI
        help
        PCI Express controller 0 sel.
        Set 0 to disable controller 0 as RC.
        set 1 to enable controller 0 to work at RC mode.

config PCIE0_DEVICES_MEM_SIZE
        hex "Total memory size of PCI Express EP devices"
        range 0x0 0x10000000 if ARCH_HI3519
        range 0x0 0x10000000 if ARCH_HI3519V101
        range 0x0 0x10000000 if ARCH_HI3516AV200
		range 0x0 0x10000000 if ARCH_HI3559
		range 0x0 0x10000000 if ARCH_HI3556
		range 0x0 0x10000000 if ARCH_HI3531D
		default "0x8000000" if ARCH_HI3519
		default "0x8000000" if ARCH_HI3519V101
        default "0x8000000" if ARCH_HI3516AV200
		default "0x8000000" if ARCH_HI3559
		default "0x8000000" if ARCH_HI3556
		default "0x8000000" if ARCH_HI3531D
        depends on PCI
        help
        Memory available for all pcie EP devices in pci subsystem.
        Hisilicon PCI Express controller provides up to 256MBytes address
	space for its subordinated devices.
	No IO address space is reserved, since to support PCI legacy devices
	which required IO address space.
        You can change this value as you please.

config PCIE0_DEVICES_CONFIG_SIZE
        hex "Sum of configuration header size mapped for all PCIe EP devices"
        range 0x0 0x10000000   if ARCH_HI3519
        range 0x0 0x10000000   if ARCH_HI3519V101
        range 0x0 0x10000000   if ARCH_HI3516AV200
		range 0x0 0x10000000   if ARCH_HI3559
		range 0x0 0x10000000   if ARCH_HI3556
		range 0x0 0x8000000    if ARCH_HI3531D
		default 0x800000       if ARCH_HI3519
		default 0x800000       if ARCH_HI3519V101
        default 0x800000       if ARCH_HI3516AV200
		default 0x800000       if ARCH_HI3559
		default 0x800000       if ARCH_HI3556
		default 0x800000       if ARCH_HI3531D
        depends on PCI
        help
	As to the PCIe address space configuration, address space for all EPs
	is up to 256Mbytes. But, normally people do not used that much. Each
	EP device will use 4Kbytes virtual address space for PCIe configuration header.
	Normally people will not use that much(256MB).
	Enlarge this value will require more system virtual address space.
	The DEFAULT value(8MB) is enough for most applications.

config LIMIT_MAX_RD_REQ_SIZE
	bool "limit pcie max read request size"
	default y
	depends on PCI && (ARCH_HI3519 || ARCH_HI3519V101 || ARCH_HI3559 || ARCH_HI3556 || ARCH_HI3516AV200) 
	help
	The default max read request size of pcie device is 512 Byte. When pcie use
	the card of pcie-to-sata to connect to the sata disk, with the default max read
	request size value of 512 byte, would cause the low bandwidth of VDP. If you enable
	the LIMIT_MAX_RD_REQ_SIZE config, the max read request size of pcie device would be
	set to 128 byte, and the problem of VDP low band width also be avoided.

config PCIE1_SEL
		int "PCI Express controller 1 sel"
		range 0 1
		default "0" if !PCI
		default "1" if PCI
		depends on (PCI && ARCH_HI3531D)
		help
		PCI Express controller 1 sel.
		Set 0 to disable controller 1,
		set 1 to enable controller 1 to work at RC mode.

config PCIE1_DEVICES_MEM_SIZE
		hex "Total memory size of PCI Express EP devices"
		range 0x0 0x8000000 if ARCH_HI3531D
		default "0x8000000" if ARCH_HI3531D
		depends on (PCI && ARCH_HI3531D)
		help
		All memory size required by all devices in pci subsystem.
		Hisilicon PCI Express controller provide up to 128M memory
		and io size for device.
		Here we set memory size up to 120M, means that io size has at least 8M
		You can change this depend on you device connected
		to Hisilicon PCI Express controller.

config PCIE1_DEVICES_CONFIG_SIZE
		hex "Total configuration header size of PCI Express system devices"
		range 0x0 0x10000000   if ARCH_HI3531D
		default 0x800000       if ARCH_HI3531D
		depends on (PCI && ARCH_HI3531D)
		help
		All configuration size required by devices connnect to
		Hisilicon PCI Express controller.
		NOTE: This will alloc memory from kernel,
		enlarge this will require the same memory.
		The default value is enough for most applications.

endmenu

endif
