README (2838B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 7 */ 8 9 Assuming a Solaris or Linux build server with one or more of the 10 following cross-compilers installed: 11 12 * Diab Data DCC ColdFire 13 * Tornado x86 14 * Tornado MIPS 15 * Tornado PPC 16 17 This explains how to set the target to build the Strata device drivers 18 for that a particular platform and chip. 19 20 Target Makefiles for the SAL and SOC device driver: 21 22 Remember that $TARGET is set to <TARGETBASE>-<TARGETPLAT>. <TARGETBASE> 23 represents the operating system environment, and <TARGETPLAT> represents 24 the platform. For example: 25 26 BMW CPCI card 27 setenv TARGET vxworks-bmw 28 <TARGETBASE> is vxworks 29 <TARGETPLAT> is bmw 30 31 Unix PCID simulation 32 setenv TARGET unix-solaris 33 <TARGETBASE> is unix 34 <TARGETPLAT> is solaris 35 36 Linux PCID simulation 37 setenv TARGET unix-linux 38 <TARGETBASE> is unix 39 <TARGETPLAT> is linux 40 41 For VxWorks builds of existing BSPs, edit the platform Makefile.$TARGET 42 and modify WIND_BASE so it points to your installed VxWorks tree. 43 44 Then to build a BSP and link to binary, go to the 45 46 sdk/systems/<TARGETBASE>/<TARGETPLAT> 47 48 directory corresponding to the system and run gmake. 49 50 It is possible to run 'make' in any subdirectory of the driver source 51 tree by setting the environment variable TARGET appropriately. The 52 compiled objects will go into that target's build subdirectory, 53 sdk/build/$TARGET. For example: 54 55 setenv TARGET vxworks-bmw 56 cd $SDK/src/soc 57 make drv.o 58 59 To compile a driver that only supports specific chips, see instructions 60 in $SDK/make/Make.local.template. Copy Make.local.template to 61 Make.local and make the required modifications. By default, the driver 62 will be built to include code for all supported chips. You may be able 63 to save some code space by customizing in support for only one or two 64 chips. 65 66 Adding new VxWorks platforms: 67 68 1) Pick a <TARGETPLAT> name for your BSP, eg, my_board_name. 69 70 2) Create a new Makefile.vxworks-my_board_name in $SDK/make. 71 It is easiest to copy from a similar existing Makefile and 72 modify it. 73 74 3) Create a new directory tree structure in $SDK/systems: 75 76 $SDK/systems/<TARGETBASE>/<TARGETPLAT> 77 78 Where TARGETBASE is vxworks and <TARGETPLAT> is your platofmr name, e.g. 79 80 $SDK/systems/vxworks/my_board_name 81 82 4) Copy the file socdiag.c and Makefile from an existing 83 directory in that configuration into the new directory. 84 85 $SDK/systems/vxworks/my_board_name/socdiag.c 86 $SDK/systems/vxworks/my_board_name/Makefile 87 88 5) Place all your BSP files in the new <TARGETPLAT> directory. 89 90 6) Edit the Makefiles in the directory tree, overriding 91 the target in the toplevel Makefile and pulling in 92 $SDK/make/Makefile.<TARGETBASE>-<TARGETPLAT>