config SYS_BOARD
    default "grx500"

config SYS_VENDOR
    default "lantiq"

config SYS_CONFIG_NAME
    default "grx500"

config DRIVER_GRX500
      bool
      default y

config SPI_SPL_SIZE
	hex
	default "0x6000" if	! ( MANUBOOT )
	default "0xA000" if ( MANUBOOT )
	depends on LTQ_BOOT_FROM_SPI

choice 
      prompt "Chipset Version"
      default GRX500_A11

config GRX500_A11
      bool "GRX500 version A11"

config GRX500_A21
      bool "GRX500 version A21"
endchoice

choice
	prompt "Board Specific"
	default BOARD_EASY350
	depends on GRX500_A21

config BOARD_EASY350
	bool "EASY350 Family Board"

config BOARD_EVM
	bool "GRX500 Evaluation Board"

endchoice

config GRX500_ROM_HEADER_BCH_CAP
       int
       default 40 if ( GRX500_A11 )
       default 8  if ( GRX500_A21 )  

config GRX500_BOOT_4KEC_ONLY
       bool "boot 4kec only"
       default n

config GRX500_THERMAL
	bool "Verify SoC temperature on power up"
	default y
	help
		This option enables SoC temperature test on power up. If SoC
		temp is too close to the maximum temperature threshold, it will
		prevent from booting into OS.

		U-boot will check temp periddically until temp is below the
		threshold.

if ( GRX500_THERMAL )
config GRX500_THERMAL_MAX_THRESHOLD
	int "Max temperature threshold"
	default 125000
	help
		System will stop if SoC temp is too close to this threashold.
endif

menu "Memory configuration for Trusted OS"
choice 
    prompt "Memory reserved for TOS"
    default TOS_128M

config TOS_16M
	bool "16M for tos"

config TOS_32M
	bool "32M for tos"

config TOS_64M
	bool "64M for tos"

config TOS_128M
	bool "128M for tos"
endchoice

choice 
    prompt "DDR present in system"
    default DDR_512M

config DDR_256M
    bool "256M DDR"

config DDR_512M
	bool "512M DDR"

config DDR_1G
    bool "1G DDR"
endchoice

config FMT1_REG
	hex  
	default "0xFF002F00" if (DDR_256M  &&  TOS_16M)
	default "0xFE002E00" if (DDR_256M  &&  TOS_32M)
	default "0xFC002C00" if (DDR_256M  &&  TOS_64M)
	default "0xF8002800" if (DDR_256M  &&  TOS_128M)
	default "0xFF003F00" if (DDR_512M  &&  TOS_16M)
	default "0xFE003E00" if (DDR_512M  &&  TOS_32M)
	default "0xFC003C00" if (DDR_512M  &&  TOS_64M)
	default "0xF8003800" if (DDR_512M  &&  TOS_128M)
	default "0xFF005F00" if (DDR_1G  &&  TOS_16M)
	default "0xFE005E00" if (DDR_1G  &&  TOS_32M)
	default "0xFC005C00" if (DDR_1G  &&  TOS_64M)
	default "0xF8005800" if (DDR_1G  &&  TOS_128M)
endmenu

menu "MIPS and DDR Settings"
config GRX500_USE_DDR_PRECONFIG
       bool "use pre-config DDR setting" 
       default n

config GRX500_DDR_CONFIG_FILE
       string "ddr config file path"
       default "ddr.conf"
       depends on GRX500_USE_DDR_PRECONFIG

choice 
	prompt "DDR Type"
	default GRX500_DDR3
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		Choose between DDR3/DDR2

config GRX500_DDR2
	bool "DDR2"

config GRX500_DDR3
	bool "DDR3"

endchoice

choice
	prompt "DDR Grade"
	default GRX500_667M_CL9
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		This options list down the CAS-Latency and DDR frequency
		that the system will run on

config GRX500_400M_CL6
	bool "400Mhz CL6"

config GRX500_533M_CL6
	bool "533Mhz CL6"

config GRX500_533M_CL7
	bool "533Mhz CL7"

config GRX500_533M_CL8
	bool "533Mhz CL8"

config GRX500_667M_CL8
	bool "667Mhz CL8"

config GRX500_667M_CL9
	bool "667Mhz CL9"

config GRX500_667M_CL10
	bool "667Mhz CL10"

config GRX500_800M_CL9
	bool "800Mhz CL9"

config GRX500_800M_CL10
	bool "800Mhz CL10"

config GRX500_800M_CL11
	bool "800Mhz CL11"

endchoice

choice 
	prompt "DDR Density Configurations"
	default GRX500_256Mx16
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		Choose the configuration of the DDR to determine the MAX size
		of the system DDR

config GRX500_32Mx16
	bool "32M x 16"

config GRX500_64Mx8
	bool "64M x 8"

config GRX500_64Mx16
	bool "64M x 16"

config GRX500_128Mx8
	bool "128M x 8"

config GRX500_128Mx16
	bool "128M x 16"

config GRX500_256Mx8
	bool "256M x 8"

config GRX500_256Mx16
	bool "256M x 16"

config GRX500_512Mx8
	bool "512M x 8"

config GRX500_512Mx16
	bool "512M x 16"

endchoice 

choice
	prompt "DDR Operating Burst Length"
	default GRX500_BL8
		depends on !GRX500_USE_DDR_PRECONFIG
	help
		Choose the operating burst length of the DDR

config GRX500_BL8
	bool "Configuration BL8"

config GRX500_BC4
	bool "Configuration BC4"

endchoice

menu "DDR Pre-Seed Rank 0 Value"
	depends on !GRX500_USE_DDR_PRECONFIG

config GRX500_1ST_SR0_VALUE
	int "Fist pre-seed value"
	default "24"

config GRX500_2ND_SR0_VALUE
	int "Second pre-seed value"
	default "24"
endmenu

menu "DDR Pre-Seed Rank 1 Value"
	depends on !GRX500_USE_DDR_PRECONFIG

config GRX500_1ST_SR1_VALUE
	int "First pre-seed value"
	default "24"

config GRX500_2ND_SR1_VALUE
	int "Second pre-seed value"
	default "24"
endmenu

choice 
	prompt "DDR Controller Speed (set as 1/2 DDR Grade/Speed)"
	default GRX500_DDR_CTRL_333M
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		DDR Controller speed. It should be set at half the speed of the 
		intended frequency of the DDR

config GRX500_DDR_CTRL_200M
	bool "DDR Controller @ 200Mhz"
	
config GRX500_DDR_CTRL_333M
	bool "DDR Controller @ 333Mhz"

config GRX500_DDR_CTRL_400M
	bool "DDR Controller @ 400Mhz"

endchoice

config GRX500_CS0_ONLY
	bool "DDR is using CS0 only"
	default y
	depends on !GRX500_USE_DDR_PRECONFIG
	help
		Select if DDR config is only using CS0.
		If DDR config uses both CS0/CS1, un-select this option

config GRX500_ADDITIVE_LATENCY
	int "DDR Additive Latency CL 'N' value" 
	default "1"
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		CL valid values: N [0, -1, -2]

comment "End of DDR configurations " 
	depends on !GRX500_USE_DDR_PRECONFIG

choice 
	prompt "MIPS CPS Speed"
	default GRX500_CPU_600M
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		Choose the frquency at which MIPS Interaptive is running

config GRX500_CPU_600M
	bool "CPU running at 600Mhz"

config GRX500_CPU_800M
	bool "CPU running at 800Mhz"

config GRX500_CPU_1000M
	bool "CPU running at 1000Mhz"
	
config GRX500_CPU_1200M
	bool "CPU running at 1200Mhz"

endchoice


choice 
	prompt "CBM Frequency settings"
	default GRX500_CBM_FREQ_200M
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		Sets the CBM frequency

config GRX500_CBM_FREQ_200M
	bool "CBM Frequency @ 200Mhz"

config GRX500_CBM_FREQ_300M
	bool "CBM Frequency @ 300Mhz"

config GRX500_CBM_FREQ_400M
	bool "CBM Frequency @ 400Mhz"

config GRX500_CBM_FREQ_480M
	bool "CBM Frequency @ 480Mhz"

config GRX500_CBM_FREQ_600M
	bool "CBM Frequency @ 600Mhz"

config GRX500_CBM_FREQ_800M
	bool "CBM Frequency @ 800Mhz"

config GRX500_CBM_FREQ_1200M
	bool "CBM Frequency @ 1200Mhz"

config GRX500_CBM_FREQ_2400M
	bool "CBM Frequency @ 2400Mhz"

endchoice

config GRX500_MIPS_ENDIAN_BE
	bool "Select to run MIPS in BE mode"
	default y
        depends on !GRX500_USE_DDR_PRECONFIG
	help
		Set MIPS to run in BE/LE

endmenu

menu "SWITCH OPTIONS"

choice 
	prompt "Interfaces"

config NETWORK_VIA_LAN
	bool "Network via LAN ports"
	select GRX500_PHY2
	select GRX500_PHY3
	select GRX500_PHY4
	select GRX500_PHY5

config NETWORK_VIA_WAN
	bool "Network via WAN port"
	select GRX500_PHY2
	select GRX500_PHY3
	select GRX500_PHY4
	select GRX500_PHY5
	select GRX500_PHY6F

endchoice

config GRX500_PHY2
	bool

config GRX500_PHY3
	bool

config GRX500_PHY4
	bool

config GRX500_PHY5
	bool

config GRX500_PHY6F
	bool

config GRX500_GPHY_FW_EMBEDDED
    bool "gphy firmware embedded"
    default y

config GRX500_GPHY_FW_ADDR
    hex
    default "0xa0220000" if ( LTQ_BOOT_FROM_SPI )
    default "0xa0229000" if ( LTQ_BOOT_FROM_NAND )
    depends on GRX500_GPHY_FW_EMBEDDED

config GRX500_EXTERN_GPHY_FW_ADDR
    hex "gphy firmware address"
    default "0xb0010000"
    depends on !GRX500_GPHY_FW_EMBEDDED

endmenu
