2018-08-07 02:14:37 -05:00
#
2018-08-23 14:05:14 -05:00
# Copyright 2017 Broadcom
2018-08-07 02:14:37 -05:00
#
2018-08-23 14:05:14 -05:00
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
2018-08-07 02:14:37 -05:00
#
# $Id: Makefile.linux-gto-2_6,v 1.42 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
i f e q ( , $( BUILD_PLATFORM ) )
#BUILD_PLATFORM=ELDK
BUILD_PLATFORM = WR_LINUX
e n d i f
# Specify the ELDK version you want to use for building SDK.
i f e q ( , $( ELDK_VERSION ) )
i f e q ( E L D K , $( BUILD_PLATFORM ) )
ELDK_VERSION = 4.0
e n d i f
e n d i f
# Specify the KERNEL VERSION you want to use for building SDK.
i f e q ( , $( KERN_VER ) )
i f e q ( E L D K , $( BUILD_PLATFORM ) )
KERN_VER = 2.6.21.7
e n d i f
e n d i f
# Specify the Windriver Linux version here.For example '2.0' as shown below.
i f e q ( W R _ L I N U X , $( BUILD_PLATFORM ) )
i f e q ( , $( WRS_LINUX_VERSION ) )
WRS_LINUX_VERSION = 2.0
e n d i f
e n d i f
#glibc_small and glibc_std have their own cross-compilation tools and and path for these tools are different as implemented below. To enable glibc_small build, line given below should be uncommented.
#WRL_GLIBC_SMALL=TRUE
i f e q ( 2 . 0 , $( WRS_LINUX_VERSION ) )
i f e q ( $( WRL_GLIBC_SMALL ) , T R U E )
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_small-
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_2.0/gto/glibc_small/build/linux-2.6.21-standard
e l s e
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_std-
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_2.0/gto/glibc_std/build/linux-2.6.21-standard
e n d i f
export WRL_GLIBC_SMALL
# After this point glibc_std and glibc_small share these flags
WRLINUX_BASE ?= /tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_EXEC_PREFIX = $( WRLINUX_BASE) /gnu/4.1-wrlinux-2.0/x86-linux2
TOOLCHAIN_BIN_DIR = $( TOOLCHAIN_EXEC_PREFIX)
WIND_LIC_PROXY = $( WRLINUX_BASE) /setup/x86-linux2/bin
WRLINUX_GNU_PATH = $( WRLINUX_BASE) /gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH : = $( TOOLCHAIN_EXEC_PREFIX ) :$( KERNDIR ) /../../host -cross /bin :$( KERNDIR ) /../../host -cross /powerpc -wrs -linux -gnu /bin :$( WRLINUX_GNU_PATH ) :$( PATH )
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
e n d i f
i f e q ( 3 . 0 , $( WRS_LINUX_VERSION ) )
i f e q ( $( WRL_GLIBC_SMALL ) , T R U E )
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_small-
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_small/build/linux-broadcom_bcm98548xmc-standard-build
KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_small/build/linux
e l s e
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_std-
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_std_debug/build/linux-broadcom_bcm98548xmc-standard-build
KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_std_debug/build/linux
e n d i f
export WRL_GLIBC_SMALL
# After this point glibc_std and glibc_small share these flags
WRLINUX_BASE ?= /tools/windriver/linux_ed/3.0/Linux
TOOLCHAIN_EXEC_PREFIX = $( WRLINUX_BASE) /wrlinux-3.0/layers/wrll-toolchain-4.3-85/powerpc/toolchain/x86-linux2
TOOLCHAIN_BIN_DIR = $( TOOLCHAIN_EXEC_PREFIX)
WIND_LIC_PROXY = $( WRLINUX_BASE) /setup/x86-linux2/bin
WRLINUX_GNU_PATH = $( WRLINUX_BASE) /wrlinux-3.0/layers/wrll-toolchain-4.3-85/powerpc/toolchain/x86-linux2/bin
override PATH : = $( TOOLCHAIN_EXEC_PREFIX ) :$( KERNDIR_STD ) /../../host -cross /bin :$( KERNDIR_STD ) /../../host -cross /powerpc -wrs -linux -gnu /bin :$( WRLINUX_GNU_PATH ) :$( PATH )
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
LINUX_INCLUDE_STD := $( KERNDIR_STD) /include
e n d i f
i f e q ( E L D K , $( BUILD_PLATFORM ) )
i f e q ( 2 . 6 . 2 1 . 7 , $( KERN_VER ) )
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := ppc_85xx-
e n d i f
i f e q ( 4 . 0 , $( ELDK_VERSION ) )
override PATH : = /tools /eldk /4.0/usr /bin :$( PATH )
e l s e
override PATH : = /tools /eldk /4.1/usr /bin :$( PATH )
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.21.7
e n d i f
e n d i f
i f e q ( E L D K , $( BUILD_PLATFORM ) )
i f e q ( 2 . 6 . 2 4 . 4 , $( KERN_VER ) )
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := ppc_85xx-
e n d i f
i f e q ( 4 . 0 , $( ELDK_VERSION ) )
override PATH : = /tools /eldk /4.0/usr /bin :$( PATH )
e l s e
override PATH : = /tools /eldk /4.1/usr /bin :$( PATH )
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.24.4
e n d i f
e n d i f
i f e q ( E L D K , $( BUILD_PLATFORM ) )
i f e q ( 2 . 6 . 2 5 , $( KERN_VER ) )
i f e q ( , $( CROSS_COMPILE ) )
CROSS_COMPILE := ppc_85xx-
e n d i f
i f e q ( 4 . 0 , $( ELDK_VERSION ) )
override PATH : = /tools /eldk /4.0/usr /bin :$( PATH )
e l s e
override PATH : = /tools /eldk /4.1/usr /bin :$( PATH )
e n d i f
KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.25
e n d i f
e n d i f
# Default Linux include directory
i f e q ( , $( LINUX_INCLUDE ) )
LINUX_INCLUDE := $( KERNDIR) /include
e n d i f
CFGFLAGS += -DSYS_BE_PIO= 1 -DSYS_BE_PACKET= 0 -DSYS_BE_OTHER= 1
ENDIAN = BE_HOST = 1
CFGFLAGS += -D$( ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING= \" GTO_MPC8548\"
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT= 32
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $( basename_flags) $( modname_flags)
ARCH = powerpc
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
# From linux/arch/ppc/Makefile
comma = ,
basetarget = $( basename $( notdir $@ ) )
modname = $( basetarget)
name-fix = $( subst $( comma) ,_,$( subst -,_,$1 ) )
basename_flags = -D" KBUILD_BASENAME=KBUILD_STR( $( call name-fix,$( basetarget) ) ) "
modname_flags = $( if $( filter 1,$( words $( modname) ) ) ,\
-D" KBUILD_MODNAME=KBUILD_STR( $( call name-fix,$( modname) ) ) " )
i f e q ( , $( KFLAG_INCLD ) )
i f e q ( 4 . 0 , $( ELDK_VERSION ) )
i f e q ( E L D K , $( BUILD_PLATFORM ) )
KFLAG_INCLD = /tools/eldk/4.0/usr/lib/gcc/powerpc-linux/4.0.0/include
e n d i f
e n d i f
i f e q ( 4 . 1 , $( ELDK_VERSION ) )
i f e q ( E L D K , $( BUILD_PLATFORM ) )
KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/powerpc-linux/4.0.0/include
e n d i f
e n d i f
i f e q ( 2 . 0 , $( WRS_LINUX_VERSION ) )
KFLAG_INCLD = $( WRLINUX_GNU_PATH) /../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include
e n d i f
i f e q ( 3 . 0 , $( WRS_LINUX_VERSION ) )
KFLAG_INCLD = $( WRLINUX_GNU_PATH) /../lib/gcc/powerpc-wrs-linux-gnu/4.3.2/include
e n d i f
e n d i f
i f d e f B R O A D C O M _ S V K
i f e q ( $ P L X _ P C I 2 L B U S , 1 )
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE
e n d i f
e n d i f
i f d e f D P P _ C H I P S
CFLAGS += -DDUNE_BCM -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
CFGFLAGS += -DSOC_CM_FUNCTION
e n d i f
i f d e f D F E _ C H I P S
CFLAGS += -DDUNE_BCM
CFGFLAGS += -DSOC_CM_FUNCTION
e n d i f
i f d e f S A N D _ C H I P S
CFLAGS += -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
e n d i f
i f d e f S H A D O W _ P L X
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK
e n d i f
i f e q ( , $( KFLAGS ) )
2018-08-23 14:05:14 -05:00
#autoconf.h was moved in later kernels
LINUX_AUTOCONF = $( LINUX_INCLUDE) /generated/autoconf.h
i f e q ( , $( shell ls $ ( LINUX_AUTOCONF ) 2>/dev /null ) )
LINUX_AUTOCONF = $( LINUX_INCLUDE) /linux/autoconf.h
e n d i f
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $( KFLAG_INCLD) -I$( LINUX_INCLUDE) -include $( LINUX_INCLUDE) /linux/version.h -include $( LINUX_AUTOCONF) -I$( KERNDIR) /arch/powerpc -I$( KERNDIR) /arch/powerpc -I$( KERNDIR) /arch/powerpc/include -I$( KERNDIR) /include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign
2018-08-07 02:14:37 -05:00
e n d i f
#Wind river Linux 3.0 needs addtional flags
i f e q ( 3 . 0 , $( WRS_LINUX_VERSION ) )
# Use MSI interrupts if kernel is compiled with MSI support.
#CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
KFLAGS += -I$( LINUX_INCLUDE_STD) -I$( KERNDIR_STD) /arch/powerpc -I$( KERNDIR_STD) /arch/powerpc/include -I$( KERNDIR_STD) /include.asm-powerpc -mno-spe
e n d i f
i f n e q ( $( targetplat ) , u s e r )
i n c l u d e $ { S D K } / m a k e / M a k e f i l e . l i n u x - k e r n e l - 2 _ 6
e n d i f