Home

LEON Linux User`s Manual

image

Contents

1. Kernel configuration When configuring the kernel select e GRLIB APBUART serial support SERIAL_GRLIB_GAISLER_APBUART under Serial drivers under Character devices To use APBUART driver for system console also select e Console on GRLIB APBUART serial port SERIAL GRLIB GAISLER APBUART CONSOLE under the former 3 9 2 2 Mklinuximg configuration The APBUART driver ignores an APBUART core if it has an amptopts property with a value of 0 This is useful when running an AMP where certain uarts are used by another operating system The ampopts property can be set in two different ways One way to add amptopts properties is to add it using the amp flag with mklinuximg The flag takes as an argument a string on the form idx0 val0 idx1 val1 that adds an amptopts property with value val0 for the core with scan index idx0 an amptopts property with value vall for the core with scan index idx1 etc The other way to add an ampopts property is to add it via xml For the APBUART case where the only function of amptopts is for the core to be ignored even easier is to delete the node of the core altogether The following example adds an amptopts property with value 0 to the first APBUART and outright deletes the third from the devicetree lt xml version 1 0 gt lt matches gt lt match core vendor VENDOR_GAISLER device GAISLER_APBUART index 0 gt lt add prop name ampopts gt lt int g
2. first GRETH If this is all zeroes the ID prom is instead used See on mklinuximg below for how to set it there greth edcl 1 Whether EDCL is used Is used to determine if PHY autonegotiation is to be done right away or not 2 Mklinuximg configuration The default MAC address for the first GRETH core can be set in the ID prom from mklinuximg by using the ethmac flag The kernel module parameter of the driver descruibed above takes precedence over this setting Framebuffer subsystem See Document ation fb in the Linux kernel source tree for general documentation about the framebuffer subsystem and its kernel and user space interfaces in Linux 3 3 1 Kernel configuration for framebuffer Enable framebuffer support in the Linux kernel by selecting e Support for frame buffer devices FB under Grahics support under Device drivers 3 3 2 SVGACTRL driver 3 4 The SVGACTRL driver follows the standard Linux kernel framebuffer interface When configuring the kernel select e Aeroflex Gaisler framebuffer support FB_GRVGA under Support for frame buffer devices GPIO subsystem See Documentation gpio txt in the Linux kernel source tree for general documentation about the GPIO subsystem and its kernel and user space interfaces in Linux See also devicetree bindings gpio gpio txt for documentation on devicetree representations 3 4 1 Kernel configuration for GPIO Enable GPIO suppo
3. int gt lt Use GPIO line 27 gt lt int gt 0 lt int gt lt add prop gt lt add node gt Kadd node name led0 gt lt add prop name default state gt lt string gt keep lt string gt lt add prop gt lt add prop name linux default trigger gt lt string gt heartbeat lt string gt lt use the heartbeat trigger driver gt lt add prop gt lt add prop name gpios gt lt corehandle ref gpio0 gt Use gpio0 gt lt int gt 28 lt int gt lt Use GPIO line 28 gt NEROFLEX LEON Linux User s Manual 8 GAISLER lt int gt 0 lt int gt lt add prop gt lt add node gt lt match core gt lt matches gt The example sets the exampleleds up as a child node of the GRGPIO core but that is not necessary Here two different LED trigger drivers uses the leds gpio driver that in turn uses GRGPIO The example depends on LED support LED Class support LED Trigger support LED Support for GPIO connected LEDs LED Heartbeat trigger LED Heartbeat Trigger and LED Default ON Trigger being enabled for the kernel For another example of setting up GPIO usage see Section 3 8 2 1 3 4 3 GPIO kernel space interface See Documentation gpio txt in the Linux kernel source for documentation on the general GPIO interface See include linux of gpio h for details on how to get from the devicetree the gpio numbers used in the general kernel interface 3 5
4. NEROFLEX GAISLER LEON Linux User s Manual LEON specific Linux documentation LINLEON Version 1 0 1 April 2015 Kungsgatan 12 tel 46 31 7758650 413 11 Gothenburg fax 46 31 421407 Sweden www aeroflex com gaisler NEROFLEX LEON Linux User s Manual 2 GAISLER LEON Linux User s Manual Copyright O 2014 Aeroflex Gaisler AB NEROFLEX LEON Linux User s Manual ili Table of Contents GAISLER ES buet Te Te 1 1 Conventions in this document 2 Contipurns the Linux Kemell o5 cciisccssssssshosnterscanseassasctyscdeenwapeshnsteecsabecnesaus EEEE EREE ES 3 Subsystems and drivers s 5 situer dinde REENEN eet 3 1 CAN ET 3 1 1 Kernel configuration for CAN 3 1 2 GRCAN and GRHCAN driver 42011 2012 mengontak Hama en eE ee ne aka 3 13 CAN EE 3 14 CAN kernel space interface Manek anne ata ena tama nan apa 3 1 5 CAN user Space interface wi Woo keisi eneun Ene EESE RESE etait 3 1 6 KEE 3 2 Ethernet SUBSYSTEM 55 nine eune nanah an ist enakan Nababan 3 2 1 GRETH 10 100 and GBIT driver o 5 c cccssctessssesnasndennbanssesboersssnctanssbacuaes nanan 3 3 Framebutter SUBSYSTEM gedeelt gesend snake DEENEN Basa nan ege EEN EEN 3 3 1 Kernel configuration for framebuffer 00 ceeeeceeceeneeeeeeeeceeeeeueeeeeeeeeeaeeeeaneeees 3 3 2 SVGACTRE driver 33h annales bites lee babe ssi SA GPIO SUBSYSTEM E 3 4 1 Kernel configuration for GPIO css season meneh REENEN in vrenin eise 3 42 GRGPIO driver 2
5. PC subsystem See Documentation i2c in the Linux kernel source tree for general documentation about the PC subsystem and its kernel and user space interfaces in Linux 3 5 1 Kernel configuration for Pc Enable PC support in the Linux kernel by selecting e DC support RC under Device Drivers 3 5 2 12CMST driver I2CMST cores use the DC Open Cores driver in Linux The driver follows the standard Linux rc interface including registering devices through the device tree When configuring the kernel select e OpenCores DC Controller 12C_OCORES under DC Hardware Bus support 3 5 2 1 Mklinuximg configuration The I2CMST driver needs special devicetree properties Mklinuximg from version 2 0 4 and onward adds these automatically To connect a TC slave device to a UC master through the device tree a node for the slave device containing some properties should be put as a child of the node for the master device A register property should contain the address of the slave on the DC bus and a compatile property should contain the name in the struct i2c_device_id of the slave device driver The following example xml file for mklinuximg adds a Dallas DS1672 real time clock as a PC slave device with chip address 0x68 to the device tree under the first IACMST core lt xml version 1 0 gt lt matches gt lt match core vendor VENDOR_GAISLER device GAISLER_I2CMST index 0 gt lt add n
6. driver 2358550 nette nce au E VEE rehab E ke maa 3 1 3 GRUSBHE UHCI driver ss sos EE enam geed mna 4 Frequently Asked Questions sorses erreren ae ea a EEEn EA EEE E nie el Eege 4 1 What causes DMA API warnings on addresses 0xf0005000 0xf0007fff Ds SUPPOME a iorno ai eE n Mean NA Eh E E EEE aan mek Be ain 6 DISClAIM E id eren Rd hand EE TEE NN OR E EEEE EAEE SESAN RNS NEROFLEX LEON Linux User s Manual 1 GAISLER 1 Introduction 1 1 This document contains documentation on configuring the Linux kernel and configuring and using device drivers for Aeroflex Gaisler IP cores Additional information can be found in the LEON Linux overview document in the documentation for the LINUXBUILD linux build environment the mklinuximg RAM loader tool and the external driver package documentation Conventions in this document When describing configuration options both the descriptive name of the option and the variable name of the option is mentioned the first in quotation marks and the latter within parenthesis E g when configuring the kernel for LEON the option described as Sparc Leon processor family should be chosen This configuration option has the varible name SPARC LEON This is mentioned as Sparc Leon processor family SPARC LEON Searches in the configurators xconfig gconfig menuconfig are matching agains the variable names Descriptions on where to find an configurati
7. organized per kernel subsystem and contains information on configuring the subsystem configuring and drivers in that subsystem information on kernel and user space interfaces and notes on using them in the Buildroot environment See separate document for drivers provided in the GRLIB Driver Package available from http gaisler com Table 3 1 Overview of Cores and Drivers Core Section Linux 3 10 Source Path Comments APBPS2 Section 3 7 2 drivers input serio In mainline since v3 10 apbps2 c APBUART Section 3 9 2 drivers tty serial In mainline since v2 6 33 apbuart c CAN_OC Section 3 1 3 drivers net can sjal000 In mainline since v3 8 sja1000 of platform c GRCAN Section 3 1 2 drivers net can grcan c In mainline since v3 8 GRETH Section 3 2 1 drivers net ethernet In mainline since v2 6 34 GRETH GBIT aeroflex greth c GRGPIO Section 3 42 drivers gpio gpio grgpio c In mainline since v3 10 GRHCAN Section 3 1 2 drivers net can grcan c In mainline since v3 8 GRPCI Section 3 6 2 arch sparc kernel In mainline since v3 10 leon_pci_grpcil c GRPCI2 Section 3 6 3 arch sparc kernel In mainline since v3 0 leon_pci_grpci2 c GRSPW2 Separate drivers grlib spw grspw c In GRLIB Driver Package document GRSPW2_ Separate drivers grlib spw In GRLIB Driver Package ROUTER document grspw_router c GRUSBDC Section 3 10 2 drivers usb gadget Available in leon linux 3 10 gr_udc c in mainline since v3 14 GR
8. 5m nama naa na he aah 3 4 3 GPIO kernel Space Interface co oo o o Wm g0 ehi abis OM ae EEN 3 5 IDE SubSY EE 3 5 1 Kernel configuration for IDC o co iiooiwins1 nous EENS osier less lensa 39 ERR EEN Ne EE 39131 PC user Space Interface 1 5 mab Eeer item has ee AE ee 3 54 IRC 10 BUIdrOOt 55e edan ana memanah Sa aan E Hah 3 6 PCL SUDSYSTE1 ss ees de EE Se DE ama mna anna mmk ia 3 6 1 Kernel confisurati n Tor PCI ii oo SEENEN ENEE KEREN EEN 3 0 2 GRI EE e EE 3 6 3 GRPCL ENEE eegne A ee ENEE EE ak ae aini E De EE 3 7 1 Kernel configuration for PS 2 oo mo m oo me1ne tenan E e aione hetusn benahi ja nh naa 3 8 SPL SUBSYSTEM sirni amari ar e E a E E ER EEE EE EE EEEE 3 8 1 Kernel configuration for SPL sessscsrsseoeresisceirescederneicasvrenene enire ea 3 8 22 EN EE EE 3 9 TTY SUDSYStEM ee EE ee ee EES 3 9 1 Kernel configuration for TTY serseri cece cece cece ea eece ceca eeaeeeaeeeneeeeeeeeeeeeeeaes 3 9 2 APBUART driver sure beban abu aa mean sanam bos sabe Busan Kanaan 3 9 3 Mklinuximg configuratiOn iesenii eiee neno EEEE a Ee EE EERE SEEE 3 10 USB device Subsystem 5 issu bike EREE AKEE EEEE TEENETE EES EA 3 10 1 Kernel configuration for USB device 2 0 0 0 cc eeceeeeeceeececeeeeeeeeeeeeeeeeaeeeeaneeeeaes 3 102 GRUSBDG ee EE 3 11 USB host subsystem se rererere nama ngebet ena anik 3 11 1 Kernel configuration for USB host cceeceeeeeeeeeceeneeeeeeeeeeeeeeaeeeeeeeeenaeeeeaes 3 12 GRUSBHC EHCI
9. AN OC driver CAN OC cores use an SJA1000 driver in Linux Only PeliCAN mode is supported The driver supports listen only mode triple samling mode one shot mode and bus error reporting The driver follows the standard Linux CAN interface 3 1 3 1 Kernel configuration To use CAN_OC select e Philips NXP SJA1000 devices CAN SJA1000 e Generic OF Platform Bus based SJA1000 driver CAN SJA1000 OF PLATFORM 3 1 3 2 Open Firmware device tree details for CAN OC One core can contain several CAN OC instantiations The version property plus one in the AMBA Plug amp Play indicates the number of CAN OC instantiations However mklinuximg creates separate virtual NEROFLEX LEON Linux User s Manual 5 GAISLER devices for the Open Firmware device tree So from the Linux kernel point of view every instantiation is a separate device The nodes are called GAISLER CANAHB in the device tree 3 1 4 CAN kernel space interface Not applicable 3 1 5 CAN user space interface CAN devices is accessed in Linux as network interfaces via sockets The interfaces are named can0 canl etc The available CAN interfaces can be seen by running sbin ip link Bitrate or specific bittiming parameters are set up from within Linux using the sbin ip command Run sbin ip link set canX type can help with X substituted by appropriate number to see the configuration parameters available Some listed parameters might not be available fo
10. Support The periferal controller driver will automatically bind to the selected gadget No further configuration is necessary To get enable debug printouts and to enable detailed information in debugfs select e Debugging messages DEVELOPMENT USB_GADGET_DEBUG e Debugging information files in debugfs DEVELOPMENT USB_GADGET_DEBUG_FS under USB Gadget Support 3 10 2 2 Mklinuximg configuration If the GRUSBDC has non default 1024 buffer sizes for the endpoints this needs to be specified in the devicetree using the property epobufsizes for OUT endpoints and epibufsizes for IN endpoins Fewer entries than endpoints overrides the default sizes only for as many endpoints as the array contains See also Documentation devicetree bindings usb gr udc txt in the Linux kernel source tree The following example xml file specifies for the first GRUSBDC core that OUT endpoint 1 has a non default buffer size of 2048 lt xml version 1 0 gt lt matches gt lt match core vendor VENDOR_GAISLER device GAISLER_USBDC index 0 gt lt add prop name epobufsizes gt lt int gt 1024 lt int gt OUT endpoint 0 has default buffer size 1024 gt lt int gt 2048 lt int gt lt OUT endpoint 1 has non default buffer size 2048 gt lt OUT endpoint 2 has default buffer size 1024 but need no entry gt lt add prop gt lt match core gt lt matches gt 3 11 USB host subsystem Se
11. Table 3 2 Kernel Parameters Parameter Default Description grcan enable0 O Default configuration of physical interface 0 Configures the Enable 0 configuration register bit grcan enablel O Default configuration of physical interface 1 Configures the Enable 1 configuration register bit grcan select 0 Default configuration of physical interface selection Configures the Select bit of the configuration register grcan txsize 1024 Configures the size of the tx buffer in bytes grcan rxsize 1024 Configures the size of the rx buffer in bytes For example adding grcan enable0 1 to the kernel command line will set the default for enable0 to 1 and keep O as the the default for enablel The settings for enable0 enablel and select settings can be overriden at runtime whereas txsize and rxsize can not The kernel parameters values can be read at runtime from sys module grcan parameters See also Documentation kernel parameters txt in the Linux kernel source tree 3 1 2 1 1 Runtime Configuration The enableO enable and select bits of the configuration register can be set at runtime via the sysfs file system under sys class net canX grcan where canX is the interface name of the device in Linux For example echo 1 gt sys class net can0 grcan enable0 will set the enable0 bit of interface can0 to 1 See also Documentation ABI testing sysfs class net grcan in the Linux kernel source tree 3 1 3 C
12. USBHC Section 3 11 2 drivers usb host e u hci In mainline since v3 0 amp grlib c Section 3 11 3 I2CMST Section 3 5 2 drivers i2c busses i2c In mainline since v3 8 ocores c SVGACTRL Section 3 3 2 drivers video grvga c In mainline since v3 2 SPICTRL Section 3 8 2 drivers spi spi fsl spi c In mainline since v3 10 3 1 CAN subsystem General documentation about CAN in Linux can be found in Documentation networking can txt in the Linux kernel source tree 3 1 1 Kernel configuration for CAN Enable CAN support in the Linux kernel by selecting e CAN bus subsystem support CAN under Networking support Under this section select the following options NEROFLEX LEON Linux User s Manual 4 GAISLER e Raw CAN Protocol CAN RAW e Platform CAN drivers with Netlink support CAN DEV e CAN bit timing calculation CAN CALC BITTIMING 3 1 2 GRCAN and GRHCAN driver The GRCAN and GRHCAN driver supports listen only mode triple samling mode when available in the core and one shot mode The driver follows the standard Linux CAN interface 3 1 2 1 Kernel configuration To use GRCAN and or GRHCAN select e Aeroflex Gaisler GRCAN and GRHCAN CAN devices CAN GRCAN under CAN Device drivers The default values of the enable0 enablel and select bits of the configuration register and the tx and rx buffer sizes can be configured via kernel paramenters listed in Table 3 2
13. ation NEROFLEX 10 GAISLER The GRPCI2 PCI Host bridge driver take configuration options controlled from the device tree The configuration options are described in the table below Table 3 4 GRPCI2 device tree properties Name Type Default Description barcfg 12 words 1 Auto Optional custom Target BAR configuration The configuration property is an array of length 12 32 bit words each pair of words describe one PCI target BAR set up The first word in a pair describes the PCI address of BAR_N and the second the AMBA AHB base address translated into The Target BAR size is calculated from the PCI BAR alignment irq_mask reset 3 7 PS 2 subsystem word word boolean O AIL O n0o rst Limit which PCT interrupts are enabled By default all are enabled This property is typically used when one or more PCI interrupt pins are not used or must be used when they are floating on the PCB The property is a 4 bit mask where bit N controls Interrupt N 0 Disable 1 Enable e bit0 PCI INTA e bit PCI INTB e bit2 PCI INTC e bit3 PCI INTD Force PCI reset on startup If the property value is set to non zero the GRPCI2 host driver will use the GRPCI2 register interface to reset the PCI bus on boot 3 7 1 Kernel configuration for PS 2 Enable PS 2 support in the Linux kernel by selecting e Serial I O support SERIO under Hardware I O ports under Input device
14. configuration options The iproute2 package provides a working sbin ip Under Network applications select e Iproute2 BR2 PACKAGE IPROUTE2 The can utils package contains the can utils toolset see Section 3 1 5 1 Under Network applications select e can utils BR2 PACKAGE CAN UTILS 3 2 Ethernet subsystem No attempt is made here to try to cover Ethernet and networking for Linux in general 3 2 1 GRETH 10 100 and GBIT driver 3 2 1 1 Kernel configuration When configuring the kernel select NEROFLEX LEON Linux User s Manual 6 GAISLER 3 2 1 3 3 e Aeroflex Gaisler GRETH Ethernet MAC support GRETH under Ethernet driver support The MAC address of the first GRETH core can be set up by a kernel module parameter described below or in the ID prom desbribed under mklinuximg configuration further down where the module parameter takes precedence Th last byte of the MAC address will get increase for each following GRETH core Table 3 3 Kernel Parameters Parameter Default Description greth debug 1 Bitmask deciding which types of messages the GRETH driver should emit See the NETIF_MSG_ enums in include linux netdevice hinthe Linux kernel source tree for the different bits It can later be set from userspace using the ethtool utility It is there called msglvl greth macaddr 0 0 0 0 0 0 Default MAC address on the form 0x08 0x00 0x20 0x30 0x40 0x50 of the
15. dor VENDOR_GAISLER device GAISLER_SPICTRL index 0 gt lt chipselect setup gt lt add prop name cs gpios gt lt chipselect 0 default gt lt int gt 0 lt int gt lt chipselect 1 line 27 of gpio0 gt lt corehandle ref gpio0 gt lt int gt 27 lt int gt lt int gt 0 lt int gt lt chipselect 2 default gt lt int gt 0 lt int gt lt add prop gt lt SPI slave gt lt add node name ad7814 gt lt add prop name reg gt lt int gt 0 lt int gt lt chipselect number gt lt add prop gt NEROFLEX LEON Linux User s Manual 12 GAISLER lt add prop name spi max freguency lt int gt 10000000 lt int gt lt add prop gt lt add prop name spi cpha gt lt Shifted clock phase mode gt lt add prop name spi cpol gt lt Inverse clock polarity mode gt lt add prop name compatible gt lt string gt adi ad7814 lt string gt lt add prop gt lt add node gt lt match core gt lt match core vendor VENDOR_GAISLER device GAISLER_GPIO index 0 gt lt corelabel name gpio0 gt lt Used by cs gpios to refer to this core gt lt match core gt lt matches gt 3 9 TTY subsystem 3 9 1 Kernel configuration for TTY Enable TTY support in the Linux kernel by selecting e Enable TTY TTY under Character devices 3 9 2 APBUART driver The APBUART driver follows the standard Linux TTY kernel interface 3 9 2 1
16. e Document at ion usb in the Linux kernel source tree for general documentation about the USB host subsystem and its kernel and user space interfaces in Linux NEROFLEX LEON Linux User s Manual 14 GAISLER 3 11 1 Kernel configuration for USB host Enable USB host support in the Linux kernel by selecting e USB support USB SUPPORT under Device drivers Under there are a myriad of options and drivers for various USB devices 3 11 2 GRUSBHC EHCI driver The GRUSBHC core suports both EHCI and UHCI standard interfaces To use the EHCI driver interface select e EHCI HCD USB 2 0 support USB EHCI HCD under USB support when configuring the kernel 3 11 3 GRUSBHC UHCI driver The GRUSBHC core suports both EHCI and UHCI standard interfaces To use the UHCI driver interface select e UHCI HCD most Intel and VIA support USB_UHCI_HCD under USB support when configuring the kernel NEROFLEX LEON Linux User s Manual 15 GAISLER 4 Freguently Asked Guestions 4 1 What causes DMA API warnings on addresses 0xf0005000 0xf0007fff This memory region is part of the kernel text section and is used to store the trap tables for CPU1 CPU3 If less than four CPUs are used the memory containing the trap tables for the unused CPUs is freed and put in the general memory pool The DMA API debug functionality enabled by compiling the kernel with the DMA_API_DEBUG option issues a warning when memory
17. from the kernel text section is used as part of a DMA operation This coarse check causes it to issue false warnings whenever the memory that formerly held the trap tables is used Here is an example of such a warning message grlib greth ffd0f610 DMA API device driver maps memory from kernel text or rodata addr f0006000 len 1352 NEROFLEX LEON Linux User s Manual 16 GAISLER 5 Support For Support contact the Aeroflex Gaisler support team at support gaisler com GAISLER LEON Linux User s Manual 17 NEROFLEX 6 Disclaimer Aeroflex Gaisler AB reserves the right to make changes to any products and services described herein at any time without notice Consult Aeroflex or an authorized sales representative to verify that the information in this document is current before using this product Aeroflex does not assume any responsibility or liability arising out of the application or use of any product or service described herein except as expressly agreed to in writing by Aeroflex nor does the purchase lease or use of a product or service from Aeroflex convey a license under any patent rights copyrights trademark rights or any other of the intellectual rights of Aeroflex or of third parties
18. here in the array the corresponding entry or entries are They are put one after another and are distinguished by if the first entry is 0 or not The array is optional If not present all chipselect numbers use the default behavior The array can also be short Any chipselect number with no entry in the array will use the default behavior To connect a SPI slave device to a SPI master through the device tree a nodefor the slave device containing some properties should be put as a child of the node for the master device A register property should contain the chipselect number address of the slave a compatible property should contain a name that is matched by the driver of the slave and a spi max frequency property should contain maximum clocking frequency of the slave The drivers also supports the optional spi cpha spi cpol and spi lsb first properties that are added as empty properties See Document at ion devicetree bindings spi spi bus txt for details The following example xml file for mklinuximg sets up the first SPICTRL core to use default chipselect behavior for chipselect numbers 0 and 2 and to use GPIO line 27 of the first GRGPIO core for chipselect number 1 It also adds a AD78 14 temperature sensor SPI slave device with chipselect number 0 to the device tree under this SPICTRL core that would need a driver matching adi ad7814 lt xml version 1 0 gt lt matches gt lt match core ven
19. ode name rtc gt lt irrelevant name gt lt add prop name reg gt lt int gt 0x68 lt int gt lt chip address gt lt add prop gt lt add prop name compatible gt lt string gt ds1672 lt string gt lt match with driver gt lt add prop gt lt add node gt NEROFLEX LEON Linux User s Manual 9 GAISLER lt match core gt lt matches gt 3 5 3 PC user space interface 3 5 3 1 The i2c tools toolset The i2c tools toolset is useful for quick testing and diagnostics of DC in Linux and the source code also serves as examples on rc programming from user space Run the i2cdetect i2cget i2cset and i2cdump commands without parameters to get rudimentary documentation Warning These commands can quoting from the man page be extremely dangerous if used improperly 3 5 4 CC in Buildroot 3 6 The i2c tools package contains the i2c tools toolset see Section 3 5 3 1 Under Hardware handling select e 12c tools BR2 PACKAGE _I2C_TOOLS Man pages for the tools in the toolset can be found under the tools directory of the i2c tools build directory e g build i2c too1ls 3 0 3 tools i2cdetect 8 and can be used by using man l PCI subsystem See Documentation PCI in the Linux kernel source tree for general documentation about the PCI subsystem and its kernel and user space interfaces in Linux The Linux PCI Host layer on a LEON system is used to perform device discover
20. on option to be chosen are often in relation to earlier selections E g in the description on how to select a driver for a specific core the description on where to find it is often described in relation to where the subsystem was configured Chapter 3 contains descriptions for setting up extra nodes and or properties in the devicetree for several cores using mklinuximg These xml files are used with the xm1 option of mklinuximg See the Mklinuximg manual for details NEROFLEX LEON Linux User s Manual 2 GAISLER 2 Configuring the Linux Kernel This chapters gives the bare minimum for configuring the Linux kernel for LEON The configurations from the leon linux kernel packages contains suitable default configurations to use as a starting point See Chapter 3 for configuration of device drivers for Aeroflex Gaisler IP cores When configuring the kernel make sure to specify ARCH sparc when starting the configurator e g make ARCH sparc xconfig Make sure that e 64 bit kernel 64BIT is not selected at top level Then select e Sparc Leon processor family SPARC LEON under Processor type and features To build an SMP kernel also select e Symmetric multi processing support SMP under Processor type and features LEON Linux User s Manual 3 Subsystems and drivers NEROFLEX GAISLER This Chapter contains documentation about drivers included in the Linux mainline kernel The chapter is
21. ould be used by setting up an array property containing GPIO information for the GPIO lines to use Each GPIO line used needs three entries in the array The first entry is a handle to the GPIO core This handle to the GPIO core is realized in mklinuximg by using the corelabel and corehandle tags The second entry is the offset within the GPIO core i e which GPIO line of the core to use The third entry is a bitmask Set bit 0 in the bitmask to 1 if the GPIO line is active low The following example sets up some LED s connected to the first GRGPIO to be used by the default on and heartbeat LED trigger drivers lt xml version 1 0 gt lt matches gt lt match core vendor VENDOR_GAISLER device GAISLER_GPIO index 0 gt lt corelabel name gpio0 gt lt For user to refer to this core gt lt Set up user that could be placed elsewhere gt lt add node name exampleleds gt lt irrelevant name gt lt add prop name compatible gt lt string gt gpio leds lt string gt lt Matches leds gpio driver gt lt add prop gt lt add node name led0 gt lt add prop name default state gt lt string gt on lt string gt lt add prop gt lt add prop name linux default trigger gt lt string gt default on lt string gt lt use the default on trigger driver gt lt add prop gt lt add prop name gpios gt lt corehandle ref gpio0 gt lt Use gpio0 gt lt int gt 27 lt
22. r particular drivers hardware Bringing a CAN interface canX up and down can be done by ifconfig canX up and ifconfig canX up respectively Bittiming parameters needs to be set before bringing a CAN interface up the first time See Documentation networking can txt in the Linux kernel source tree for more details on configuration and the CAN specific configuration parameters of sbin ip Note as of Linux 3 8 hardware filtering is not supported in Linux 3 1 5 1 The can utils toolset The can utils toolset can be used as quick testing and diagnostics tools and the source code also serves as examples on socket programming for CAN interfaces The following example sets up interface can0 at 125 kbps enables the interface starts candump with parameters set to receive any can frames including error frames and sends a frame using on the CAN bus that is received by candump sbin ip link set can0 type can bitrate 125000 sbin ifconfig can0 up candump e any 0 0 FFFFFFFF amp cansend can0 123 abcdef can0 123 3 AB CD EF He HEHE HE Note that if there are no other active devices on the bus the transmit fails even if a local candump is listening to the socket In the case above where one shot mode has not been specified the controller would retry until it ends up in an error passive state and error frame s would instead be delivered to candump 3 1 6 CAN in Buildroot The built in ip command of BusyBox can not currently handle all CAN
23. rt in the Linux kernel by selecting e GPIO Support GPIOLIB under Device Drivers NEROFLEX LEON Linux User s Manual 7 GAISLER 3 4 2 GRGPIO driver The GRGPIO driver follows the standard Linux GPIO interface including setting up GPIO usage from other devices in the devicetree 3 4 2 1 Kernel configuration When configuring the kernel select e Aeroflex Gaisler GRGPIO support GPIO_GRGPIO under GPIO Support 3 4 2 2 Mklinuximg configuration The GRGPIO driver needs special devicetree properties Mklinuximg from version 2 0 6 have support for generating them from explicitely specified information or from autoprobing the core when possible The following options all take a comma separated list of values with one value for each GRGPIO core in the system in scan order The gpio irqgen option specifies the irqgen generic for each core Autoprobing can not distinguish between 0 and 1 The gpio nbits option specifies the nbit s generic for each core i e the number of GPIO lines The gpio imask option specifies the imask generic for each core i e which GPIO lines have interrupt support The gpio noprobe option makes sure that no autoprobing is being done Otherwise probing is done for information not specified by the above options 3 4 2 3 Mklinuximg configuration for GPIO users It is possible for some drivers that uses GPIO to specify in the devicetree which GPIO core and GPIO line that sh
24. support under Device drivers 3 7 2 APBPS2 driver a The APBPS2 driver follows the standard Linux kernel PS 2 interface When configuring the kernel select e GRLIB APBPS2 PS 2 keyboard mouse controller SERIO_APBPS2 under Hardware I O ports 3 8 SPI subsystem The SPI subsystem in Linux only has support for SPI masters See Documentation spi in the Linux kernel source tree for general documentation about the SPI subsystem and its kernel and user space interfaces in Linux 3 8 1 Kernel configuration for SPI Enable SPI support in the Linux kernel by selecting e SPI support SPI under Device Drivers 3 8 2 SPICTRL driver The driver for SPICTRL is integrated with the driver for the Freescale SPI controller The driver follows the standard Linux SPI interface including registering devices through the device tree NEROFLEX LEON Linux User s Manual 11 GAISLER When configuring the kernel select e Freescale SPI controller and Aeroflex Gaisler GRLIB SPI controller SPI FSL SPI under SPI support For the chipselect signal the SPICTRL driver can use a combination of the slave select register of SPICTRL core if available and external GPIO cores if configured Each on the SPI bus where SPICTRL is the master has a chipselect number If the slave select register is available the slave select register will be used by default for chipselect numbers 0 slvselsz 1 where sl
25. t 0 lt int gt lt add prop gt lt match core gt lt del core vendor VENDOR_GAISLER device GAISLER_APBUART index 2 gt lt matches gt 3 9 3 Mklinuximg configuration To set up an UART as system console use the console kernel parameter to choose UART and baud rate Commands line options can be set using the cmdline option of mklinuximg For example using NEROFLEX LEON Linux User s Manual 13 GAISLER mklinuximg with cmdline console ttyS0 38400 sets up console on ttySO which is the first UART in the system with baud rate of 38400 3 10 USB device subsystem See Documentation usb in the Linux kernel source tree for general documentation about the USB device subsystem and its kernel and user space interfaces in Linux 3 10 1 Kernel configuration for USB device Enable USB device support in the Linux kernel by selecting e USB support USB SUPPORT and under there e USB Gadget Support USB GADGET under Device drivers Under USB Gadget Support select the preferred gadget driver 3 10 2 GRUSBDC driver The GRUSBDC driver follows the standard Linux device periferal controller interface and will be matched with the selected gadget driver The driver only supports AHB master mode 3 10 2 1 Kernel configuration When configuring the kernel select e Aeroflex Gaisler GRUSBDC USB Peripheral Controller Driver USB GR UDC under USB Peripheral Controller under USB Gadget
26. vselsz is the number of slave select signals of the SPICTRL core For other chipselect numbers the default behavior of the driver is to do nothing i e an always driven chipselect signal would be needed The driver can be configured to use the GPIO subsystem to drive chipselect signals for some chipselect numbers See Documentation devicetree bindings spi spi bus txt on needed devicetree nodes and properties for chipselects and slave devices and see below on how to realize this using mklinuximg 3 8 2 1 Mklinuximg configuration The SPICTRL driver needs special devicetree properties Mklinuximg from version 2 0 4 and onward adds these automatically To make the SPICTRL driver use a GPIO core to handle some or all of the chipselect signals an array property named cs gpios A chipselect that uses the default behavior i e slave select register or always selected should have one entry in the array containing 0 A chipselect that uses a GPIO line should have three entries in the array The first entry is a handle to the GPIO core and is guaranteed to not be 0 This handle to the GPIO core is realized in mklinuximg by using the corelabel and corehandle tags The second entry is the offset within the GPIO core i e which GPIO line of the core to use The third entry is a bitmask Typically e g for the GRGPIO core set bit 0 in the bitmask to 1 if the GPIO line is active low Note that there is no way to know directly from chipselect number w
27. y using PCI Plug amp Play enumerating PCI buses found allocating the PCI address space and basic device initialization Its up to the PCI host bridge driver to set up and start the initialization The LEON host bridge drivers assume that PCI have not been initialized by the bootloader since before The Linux PCI Host layer on a LEON system is used to perform device discovery using PCI Plug amp Play enumerating PCI buses found allocating the PCI address space and basic device initialization Its up to the PCI host bridge driver to set up and start the initialization The LEON host bridge drivers assume that PCI have not been initialized by the bootloader since before Note This section only describes the LEON acting as a PCI Host There is no specific support for PCI peripheral mode In peripheral mode the host typically has a driver for the LEON peripheral which communicates over the LEON peripheral main memory 3 6 1 Kernel configuration for PCI Enable PCI support in the Linux kernel by selecting e Support for PCI and PS 2 keyboard mouse PCI under Bus options PCI etc 3 6 2 GRPCI driver When configuring the kernel select e GRPCI Host Bridge Support SPARC GRPCII under Bus options PCI etc 3 6 3 GRPCI2 driver When configuring the kernel select e GRPCI2 Host Bridge Support SPARC GRPCI2 under Bus options PCI etc LEON Linux User s Manual 3 6 3 1 Mklinuximg configur

Download Pdf Manuals

image

Related Search

Related Contents

2D Barcode VCL Components User Manual - Han-soft  Massive Table lamp 36284/29/10  sample plan  HP 1333A Universal Counter Service Manual  SEMAINE N°40 PASSAGER 57  La notion de besoin terminologique et la naissance de lexiques  Bedienungsanleitung    GENERAL USER`S MANUAL - Metropolitan State University of Denver  Nikon Coolpix S10 User`s Manual  

Copyright © All rights reserved.
Failed to retrieve file