embedded-linux

Working of __asm__ __volatile__ (“” : : : “memory”)

南笙酒味 提交于 2019-11-27 06:19:19
What basically __asm__ __volatile__ () does and what is significance of "memory" for ARM architecture? asm volatile("" ::: "memory"); creates a compiler level memory barrier forcing optimizer to not re-order memory accesses across the barrier. For example, if you need to access some address in a specific order (probably because that memory area is actually backed by a different device rather than a memory) you need to be able tell this to the compiler otherwise it may just optimize your steps for the sake of efficiency. Assume in this scenario you must increment a value in address, read

What does request_mem_region() actually do and when it is needed?

青春壹個敷衍的年華 提交于 2019-11-27 03:59:14
问题 I'm studying on writing embedded linux driver, and decided to fire a few GPIOs to make sure I understand the book (LDD3, chap9.4.1) correctly. I am able to control the correct GPIO pins as intended (making it high and low, I probed with a multimeter); however, I tested 2 pieces of code, one with request_mem_region() , and one without. I'm expecting the one without will fail, but both is working just fine. Code with request_mem_region : if( request_mem_region( PIN3_CONF_PHYS, MAPPED_SIZE_GPIO

Why does arm-linux-gnueabi-g++-4.4 always build a “7-A” binary?

让人想犯罪 __ 提交于 2019-11-27 02:31:22
问题 I'm running Ubuntu 12:04LTS and installed arm-linux-gnueabi C and C++ compiler. The compiled binary won't run on my target board. It looks like even if I specify the cpu and arch, the compiler still builds a binary for the wrong CPU. Instead of atm9tdmi it build and 7-A. Am I doing something wrong or is there something I should have configured? Thanks. ~/ArmTest$ arm-linux-gnueabi-g++-4.4 -mcpu=arm9tdmi -march=armv4t -O main.cpp -o CPPTest ~/ArmTest$ readelf -A CPPTest Attribute Section:

How do I find ARM Linux entry point when it fails to uncompress?

吃可爱长大的小学妹 提交于 2019-11-27 02:06:25
I am trying to boot Linux via U-boot on a custom board with i.MX6 (CPU core is ARM Cortex A9) We seem to have ported Das U-Boot(2009.08) successfully. But booting Linux fails at the last U-Boot message: "Starting kernel ..." Here is my relevant environment: bootargs=console=ttymxc1,115200 vmalloc=400M root=/dev/mmcblk0p1 rootwait consoleblank=0 earlyprintk video=mxcfb0:dev=lcd,LCD-ORTUS,if=RGB24 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24 calibration tsdev=tsc2004 fbmem=10M,28M bootcmd=ext2load mmc 0:1 10800000 /boot/uImage ; bootm 10800000 The boot output is Loading file "/boot/uImage" from

Cross compiling a kernel module

孤者浪人 提交于 2019-11-27 00:22:06
问题 I'm trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host. The codesourcery tool chain for ARM is located at: /home/ravi/workspace/hawk/arm-2009q3 The kernel source is located at : /home/ravi/workspace/hawk/linux-omapl1 My Makefile: ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi obj-m := Hello.o KDIR := /home/ravi/workspace/hawk/linux-omapl1 PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules clean: $(MAKE) -C $(KDIR) SUBDIRS=$

Image vs zImage vs uImage

五迷三道 提交于 2019-11-26 21:25:33
What is the difference between them? I know that u-boot needs a kernel in uImage format. The system I use first boots from stage 1 loader and then it calls u-boot. I want to discard u-boot and directly boot from stage 1 loader. Which type of kernel image do I have to use? What is the difference between them? Image : the generic Linux kernel binary image file. zImage : a compressed version of the Linux kernel image that is self-extracting. uImage : an image file that has a U-Boot wrapper (installed by the mkimage utility) that includes the OS type and loader information. A very common practice

How to add a Linux kernel driver module as a Buildroot package?

做~自己de王妃 提交于 2019-11-26 21:25:32
问题 I am currently building an Embedded Linux for my Zybo Board from Xilinx. For this I use Buildroot. Now I want to add a driver, written in C, which can be used by a user program to write to some specific registers, enabling it to control some LEDs. When I checked the manual, it basically says the first thing to do is create a Config.in in a new package folder, where you write some text explaining the driver. Okay, I did that. But now the makefile: I don't quite understand what needs to be in

Driving Beaglebone GPIO through /dev/mem

假装没事ソ 提交于 2019-11-26 18:55:55
问题 I'm trying to write a C program for blinking a LED on the Beaglebone. I know I can use the sysfs way...but I'd like to see if it is possible to get the same result mapping the physical address space with /dev/mem. I have a header file, beaglebone_gpio.h wit the following contents: #ifndef _BEAGLEBONE_GPIO_H_ #define _BEAGLEBONE_GPIO_H_ #define GPIO1_START_ADDR 0x4804C000 #define GPIO1_END_ADDR 0x4804DFFF #define GPIO1_SIZE (GPIO1_END_ADDR - GPIO1_START_ADDR) #define GPIO_OE 0x134 #define GPIO

Pass large amount of binary data from u-boot to linux kernel

前提是你 提交于 2019-11-26 18:16:37
问题 Have some issues with passing large amount of data (3 MB) from uboot to linux kernel 2.6.35.3 on imx50 ARM board. This data is required in kernel device driver probe function and then it should be released. First uboot load data from flash to RAM, then pass physical address for linux kernel using bootargs. In kernel I try to reserve certain amount of memory using reserve_resource() in arch/arm/kernel/setup.c file: --- a/arch/arm/kernel/setup.c Tue Jul 17 11:22:39 2012 +0300 +++ b/arch/arm

Explaination of ARM (especifically mobile) Peripherals Addressing and Bus architecture?

六月ゝ 毕业季﹏ 提交于 2019-11-26 17:46:39
问题 I will first say that I'm not expert in the field and my question might contain misunderstanding, in which case, I'll be glad if you correct me and attach resources so I can learn further details. I'm trying to figure out the way that the system bus and how the various devices that appear in a mobile device (such as sensors chips, wifi/BT SoC, touch panel, etc.) are addressed by the CPU (and by other MCUs). In the PC world we have the bus arbitrator that route the commands/data to the devices