aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-lantiq/Makefile
blob: 9b20777895b17451c069cdf00d1a38e72691b604 (plain)
1
2
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = atmel-dfu

# Build Options
#   change yes to no to disable
#
BOOTMAGIC_ENABLE = lite     # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes       # Mouse keys
EXTRAKEY_ENABLE = yes       # Audio control and System control
CONSOLE_ENABLE = no         # Console for debug
COMMAND_ENABLE = no         # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes           # USB Nkey Rollover
BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
BLUETOOTH_ENABLE = no       # Enable Bluetooth
AUDIO_ENABLE = no           # Audio output
NO_USB_STARTUP_CHECK = no   # Disable initialization only when usb is plugged in
>233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
#
# Copyright (C) 2012-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=u-boot
PKG_VERSION:=2013.10
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
	http://mirror2.openwrt.org/sources \
	ftp://ftp.denx.de/pub/u-boot
PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
PKG_TARGETS:=bin

PKG_BUILD_PARALLEL:=1

FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq

include $(INCLUDE_DIR)/package.mk

define uboot/Default
  TITLE:=
  SOC:=
  DDR_SETTINGS:=
  IMAGE:=
  DEPS:=
endef

define uboot/arv4519pw_ram
  TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV4519PW
endef

define uboot/arv4519pw_nor
  TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV4519PW
endef

define uboot/arv4519pw_brn
  TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV4519PW
endef

define uboot/arv7510pw_ram
  TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV4510PW
endef

define uboot/arv7510pw_nor
  TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV4510PW
endef

define uboot/arv7510pw_brn
  TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV4510PW
endef

define uboot/arv7510pw22_ram
  TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV7510PW22
endef

define uboot/arv7510pw22_nor
  TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV7510PW22
endef

define uboot/arv7510pw22_brn
  TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV7510PW22
endef

define uboot/arv7518pw_ram
  TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV7518PW
endef

define uboot/arv7518pw_nor
  TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV7518PW
endef

define uboot/arv7518pw_brn
  TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV7518PW
endef

define uboot/arv752dpw_ram
  TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV752DPW
endef

define uboot/arv752dpw_nor
  TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV752DPW
endef

define uboot/arv752dpw_brn
  TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV752DPW
endef

define uboot/arv752dpw22_ram
  TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ARV752DPW22
endef

define uboot/arv752dpw22_nor
  TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV752DPW22
endef

define uboot/arv752dpw22_brn
  TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ARV752DPW22
endef

define uboot/gigasx76x_ram
  TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_GIGASX76X
endef

define uboot/gigasx76x_nor
  TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_GIGASX76X
endef

define uboot/acmp252_ram
  TITLE:=U-Boot for AudioCodes MP-252 (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_ACMP252
endef

define uboot/acmp252_nor
  TITLE:=U-Boot for AudioCodes MP-252 (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_ACMP252
endef

define uboot/easy50712_ram
  TITLE:=U-Boot for Lantiq EASY50712 (RAM)
  SOC:=danube
  DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
  DEPS:=@TARGET_lantiq_xway_EASY50712
endef

define uboot/easy50712_nor
  TITLE:=U-Boot for Lantiq EASY50712 (NOR)
  SOC:=danube
  DEPS:=@TARGET_lantiq_xway_EASY50712
endef

define uboot/easy50712_norspl
  TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
  SOC:=danube
  IMAGE:=u-boot.ltq.lzo.norspl
  DEPS:=@TARGET_lantiq_xway_EASY50712
endef

define uboot/easy80920_ram
  TITLE:=U-Boot for Lantiq EASY80920 (RAM)
  SOC:=vr9
  DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
  DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
endef

define uboot/easy80920_nor
  TITLE:=U-Boot for Lantiq EASY80920 (NOR)
  SOC:=vr9
  DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
endef

define uboot/easy80920_norspl
  TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
  SOC:=vr9
  IMAGE:=u-boot.ltq.lzo.norspl
  DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
endef

define uboot/easy80920_sfspl
  TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
  SOC:=vr9
  IMAGE:=u-boot.ltq.lzo.sfspl
  DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
endef

define uboot/fb3370_eva
  TITLE:=U-Boot for AVM FRITZ3370 (EVA)
  SOC:=vr9
  DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
endef

define uboot/fb3370_ram
  TITLE:=U-Boot for AVM FRITZ3370 (RAM)
  SOC:=vr9
  DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
  DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
endef

define uboot/fb3370_sfspl
  TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
  SOC:=vr9
  IMAGE:=u-boot.ltq.lzo.sfspl
  DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
endef

define uboot/p2812hnufx_ram
  TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
  SOC:=vr9
  DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
  DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
endef

define uboot/p2812hnufx_nandspl
  TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
  SOC:=vr9
  IMAGE:=u-boot.ltq.lzo.nandspl
  DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
endef


UBOOTS:= \
	arv4519pw_ram arv4519pw_nor arv4519pw_brn \
	arv7510pw_ram arv7510pw_nor arv7510pw_brn \
	arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
	arv7518pw_ram arv7518pw_nor arv7518pw_brn \
	arv752dpw_ram arv752dpw_nor arv752dpw_brn \
	arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
	gigasx76x_ram gigasx76x_nor \
	acmp252_ram acmp252_nor \
	easy50712_ram easy50712_nor easy50712_norspl \
	easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
	fb3370_eva fb3370_ram fb3370_sfspl \
	p2812hnufx_ram p2812hnufx_nandspl

define Package/uboot/template
define Package/uboot-lantiq-$(1)
  SECTION:=boot
  CATEGORY:=Boot Loaders
  DEPENDS:=$(3)
  TITLE:=$(2)
  URL:=http://www.denx.de/wiki/U-Boot
  VARIANT:=$(1)
  MAINTAINER:=Luka Perkov <luka@openwrt.org>
endef
endef

define BuildUBootPackage
	$(eval $(uboot/Default))
	$(eval $(uboot/$(1)))
	DEPS:=$(uboot/$(1)/DEPS)
	$(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
endef

define CopyVR9Firmware
	$(CP) $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
		$(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
endef

define Build/Prepare
	$(call Build/Prepare/Default)
	mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
	$(call CopyVR9Firmware,11g,1)
	$(call CopyVR9Firmware,11g,2)
	$(call CopyVR9Firmware,22f,1)
	$(call CopyVR9Firmware,22f,2)
endef

define Build/Configure
	$(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
endef

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
endef

define Package/uboot/install/default
	$(CP) \
		$(PKG_BUILD_DIR)/$(2) \
		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
endef

define Package/uboot/install/uart
	awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
		-v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
		> $(PKG_BUILD_DIR)/ddr_settings
	perl $(PKG_BUILD_DIR)/tools/gct.pl \
		$(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
 endef

define Package/uboot/install/template
define Package/uboot-lantiq-$(1)/install
	$(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
	$(if $(DDR_SETTINGS), \
		$(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
	)
endef
endef

$(foreach u,$(UBOOTS), \
	$(eval $(call BuildUBootPackage,$(u))) \
	$(eval $(call Package/uboot/install/template,$(u))) \
	$(eval $(call BuildPackage,uboot-lantiq-$(u))) \
)