📄 patch-2.6.19-omap1
字号:
++E) omap_set_gpio_dataout(int gpio, int enable)++Description: This function is responsible for writing to a pin.++Parameter: int gpio - GPIO PIN (Pin 0-63)+ int enable - pin value (0 or 1)++F) omap_get_gpio_datain(int gpio)++Description: This function is responsible for reading pin values.++Parameter: int gpio - GPIO PIN (Pin 0-63)++G) omap_free_gpio(int gpio)++Description: This function is responsible for freeing the pin used.++Parameter: int gpio - GPIO PIN (Pin 0-63)++H) OMAP_GPIO_IRQ(int gpio)++Description: Returns the Interrupt number for the specified gpio pin.++Parameter: int gpio - GPIO PIN (Pin 0-63)++I) set_irq_type(unsigned int irq, unsigned int type)++Description: This function is responsible for setting the type of interrupt+ (RISING or FALLING).++Parameter: unsigned int irq - The interrupt number for the gpio pin.+ unsigned int type - (IRQT_RISING = rising, IRQT_FALLING= falling)+++III. Example+------------++1) Writing to gpio pin#3 a value 1 and reading the value of gpio pin#3.++#include <asm/arch/gpio.h>++int ret; /* Return value */++omap_request_gpio(3); /* Request for gpio pin */+omap_set_gpio_direction(3,0);+omap_set_set_dataout(3,1); /* Writing a 1 to gpio pin # 3: */+ret = omap_get_datain(3); /* Reading the value of pin # 3 */+printk("value of pin # 3 = %d\n",ret);+omap_free_gpio(3); /* Freeing gpio pin # 3 */++2) Interrupt input by gpio pin#3++#include <asm/arch/gpio.h>++omap_request_gpio(3); /* Request for gpio pin */+omap_set_gpio_direction(3,0);+set_irq_type(OMAP_GPIO_IRQ(3),IRQT_RISING); /* Setting up pin for interrupt */+request_irq(OMAP_GPIO_IRQ(3), (void *)&my_int_handler, SA_SHIRQ,....);++... /* Do stuff, handle interrupts in my_int_handler */++free_irq(OMAP_GPIO_IRQ(3),&id); /* Freeing interrupt and gpio pin */+omap_free_gpio(3);++------------------------------------------------------------------+Last modified 14. August 2006+The OMAP Linux Kernel Team+Arnold <abo_gwapo@yahoo.com>+Dirk Behme <dirk.behme@gmail.com>++ OMAP GPIO API's HowTo+ =====================++This document is a short summary how to use OMAP Linux GPIO API. It is+mainly focussed on OMAP5912 OSK, but should fit with extensions (more+or less GPIOs) to other OMAP processors as well.++If anything is missing, is wrong, needs extension or update, please send+update to Linux-omap-open-source@linux.omap.com.++I. GPIO Modules/Banks+---------------------++OMAP5912 OSK has 64 GPIOs (general purpose IO pins). These are organized+in four modules (banks) with 16 pins each. OMAP GPIO API doesn't distinguish+between modules and numbers the pins from 0 - 63:++A) GPIO MODULE/BANK 0 - PIN 0-15+B) GPIO MODULE/BANK 1 - PIN 16-31+C) GPIO MODULE/BANK 2 - PIN 32-47+D) GPIO MODULE/BANK 3 - PIN 48-63++See++http://www-s.ti.com/sc/psheets/spru767a/spru767a.pdf++for more details.++II. GPIO API's+--------------++A) Include++#include <asm/arch/gpio.h>++B) omap_cfg_reg(xxxx);++Description: Configure pin mux.++Parameter: Pin to be configured for GPIO.++Note: This function may only be necessary for some GPIO pins. Because OMAP+ chip itself has less real hardware pins than necessary to use all+ its functionality at the same time, some pins share different+ functions (called pin multiplexing, short pin mux). E.g. one pin may+ be used for serial interface *or* GPIO. Check if this is the case for+ the GPIO you want to use and if you have to configure the pin mux.++C) omap_request_gpio(int gpio)++Description: Request GPIO to be used.++Parameter: int gpio - GPIO PIN (Pin 0-63)++Note: Using this function, you dont have to worry about banks/modules where+ the gpio pin is.++D) omap_set_gpio_direction(int gpio, int is_input)++Description: This function is responsible for setting the gpio pin direction+ (input or output).++Parameter: int gpio - GPIO PIN (Pin 0-63)+ int is_input - pin direction (0 = output, 1 = input)++E) omap_set_gpio_dataout(int gpio, int enable)++Description: This function is responsible for writing to a pin.++Parameter: int gpio - GPIO PIN (Pin 0-63)+ int enable - pin value (0 or 1)++F) omap_get_gpio_datain(int gpio)++Description: This function is responsible for reading pin values.++Parameter: int gpio - GPIO PIN (Pin 0-63)++G) omap_free_gpio(int gpio)++Description: This function is responsible for freeing the pin used.++Parameter: int gpio - GPIO PIN (Pin 0-63)++H) OMAP_GPIO_IRQ(int gpio)++Description: Returns the Interrupt number for the specified gpio pin.++Parameter: int gpio - GPIO PIN (Pin 0-63)++I) set_irq_type(unsigned int irq, unsigned int type)++Description: This function is responsible for setting the type of interrupt+ (RISING or FALLING).++Parameter: unsigned int irq - The interrupt number for the gpio pin.+ unsigned int type - (IRQT_RISING = rising, IRQT_FALLING= falling)+++III. Example+------------++1) Writing to gpio pin#3 a value 1 and reading the value of gpio pin#3.++#include <asm/arch/gpio.h>++int ret; /* Return value */++omap_request_gpio(3); /* Request for gpio pin */+omap_set_gpio_direction(3,0);+omap_set_set_dataout(3,1); /* Writing a 1 to gpio pin # 3: */+ret = omap_get_datain(3); /* Reading the value of pin # 3 */+printk("value of pin # 3 = %d\n",ret);+omap_free_gpio(3); /* Freeing gpio pin # 3 */++2) Interrupt input by gpio pin#3++#include <asm/arch/gpio.h>++omap_request_gpio(3); /* Request for gpio pin */+omap_set_gpio_direction(3,0);+set_irq_type(OMAP_GPIO_IRQ(3),IRQT_RISING); /* Setting up pin for interrupt */+request_irq(OMAP_GPIO_IRQ(3), (void *)&my_int_handler, SA_SHIRQ,....);++... /* Do stuff, handle interrupts in my_int_handler */++free_irq(OMAP_GPIO_IRQ(3),&id); /* Freeing interrupt and gpio pin */+omap_free_gpio(3);++------------------------------------------------------------------+Last modified 14. August 2006+The OMAP Linux Kernel Team+Arnold <abo_gwapo@yahoo.com>+Dirk Behme <dirk.behme@gmail.com>diff --git a/Makefile b/Makefileindex aef9625..3932e83 100644--- a/Makefile+++ b/Makefile@@ -10,6 +10,9 @@ # More info can be located in ./README # Comments in this file are targeted only to the developer, do not # expect to learn how to build the kernel reading this file. +# Add custom flags here to avoid conflict with updates+EXTRAVERSION := $(EXTRAVERSION)-omap1+ # Do not print "Entering directory ..." MAKEFLAGS += --no-print-directory @@ -159,6 +162,7 @@ SUBARCH := $(shell uname -m | sed -e s/i -e s/arm.*/arm/ -e s/sa110/arm/ \ -e s/s390x/s390/ -e s/parisc64/parisc/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )+SUBARCH := arm # Cross compiling and selecting different set of gcc/bin-utils # ---------------------------------------------------------------------------@@ -180,7 +184,7 @@ # Default value for CROSS_COMPILE is not # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH ?= $(SUBARCH)-CROSS_COMPILE ?=+CROSS_COMPILE ?= arm-linux- # Architecture as present in compile.h UTS_MACHINE := $(ARCH)diff --git a/arch/arm/Kconfig b/arch/arm/Kconfigindex ce00c57..8903bf9 100644--- a/arch/arm/Kconfig+++ b/arch/arm/Kconfig@@ -596,8 +596,7 @@ config LEDS system, but the driver will do nothing. config LEDS_TIMER- bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \- MACH_OMAP_H2 || MACH_OMAP_PERSEUS2+ bool "Timer LED" if !ARCH_CDB89712 depends on LEDS default y if ARCH_EBSA110 help@@ -612,8 +611,7 @@ config LEDS_TIMER will overrule the CPU usage LED. config LEDS_CPU- bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \- !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2+ bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110) depends on LEDS help If you say Y here, the red LED will be used to give a good real@@ -927,6 +925,12 @@ source "drivers/mmc/Kconfig" source "drivers/rtc/Kconfig" +source "drivers/ssi/Kconfig"++if ARCH_OMAP+source "drivers/cbus/Kconfig"+endif+ endmenu source "fs/Kconfig"diff --git a/arch/arm/Makefile b/arch/arm/Makefileindex 6f4f8bf..4bb4d1a 100644--- a/arch/arm/Makefile+++ b/arch/arm/Makefile@@ -69,7 +69,7 @@ tune-$(CONFIG_CPU_SA110) :=-mtune=strong tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale-tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)+tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=arm1136jfs) ifeq ($(CONFIG_AEABI),y) CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interworkdiff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignorenew file mode 100644index 0000000..fc9b99c--- /dev/null+++ b/arch/arm/boot/.gitignore@@ -0,0 +1,3 @@+Image+zImage+uImagediff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignorenew file mode 100644index 0000000..aefee20--- /dev/null+++ b/arch/arm/boot/compressed/.gitignore@@ -0,0 +1 @@+piggy.gzdiff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefileindex adddc71..6bebde5 100644--- a/arch/arm/boot/compressed/Makefile+++ b/arch/arm/boot/compressed/Makefile@@ -50,6 +50,10 @@ ifeq ($(CONFIG_ARCH_AT91RM9200),y) OBJS += head-at91rm9200.o endif +ifeq ($(CONFIG_MACH_OMAP_PERSEUS2),y)+OBJS += head-omap.o+endif+ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) ifeq ($(CONFIG_CPU_CP15),y) OBJS += big-endian.odiff --git a/arch/arm/boot/compressed/head-omap.S b/arch/arm/boot/compressed/head-omap.Snew file mode 100644index 0000000..ba3ecca--- /dev/null+++ b/arch/arm/boot/compressed/head-omap.S@@ -0,0 +1,18 @@+/*+ * linux/arch/arm/boot/compressed/head-omap.S+ *+ * OMAP specific tweaks. This is merged into head.S by the linker.+ *+ */++#include <linux/linkage.h>+#include <asm/mach-types.h>++ .section ".start", "ax"++__OMAP_start:+#ifdef CONFIG_MACH_OMAP_PERSEUS2+ /* support for booting without u-boot */+ mov r7, #(MACH_TYPE_OMAP_PERSEUS2 & ~0xf)+ orr r7, r7, #(MACH_TYPE_OMAP_PERSEUS2 & 0xf)+#endifdiff --git a/arch/arm/configs/ams_delta_defconfig b/arch/arm/configs/ams_delta_defconfignew file mode 100644index 0000000..1986bca--- /dev/null+++ b/arch/arm/configs/ams_delta_defconfig@@ -0,0 +1,1217 @@+#+# Automatically generated make config: don't edit+# Linux kernel version: 2.6.18-omap1+# Tue Oct 10 22:26:32 2006+#+CONFIG_ARM=y+CONFIG_MMU=y+CONFIG_GENERIC_HARDIRQS=y+CONFIG_HARDIRQS_SW_RESEND=y+CONFIG_GENERIC_IRQ_PROBE=y+CONFIG_RWSEM_GENERIC_SPINLOCK=y+CONFIG_GENERIC_HWEIGHT=y+CONFIG_GENERIC_CALIBRATE_DELAY=y+CONFIG_VECTORS_BASE=0xffff0000+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"++#+# Code maturity level options+#+CONFIG_EXPERIMENTAL=y+CONFIG_BROKEN_ON_SMP=y+CONFIG_LOCK_KERNEL=y+CONFIG_INIT_ENV_ARG_LIMIT=32++#+# General setup+#+CONFIG_LOCALVERSION=""+CONFIG_LOCALVERSION_AUTO=y+# CONFIG_SWAP is not set+CONFIG_SYSVIPC=y+# CONFIG_POSIX_MQUEUE is not set+# CONFIG_BSD_PROCESS_ACCT is not set+# CONFIG_TASKSTATS is not set+# CONFIG_AUDIT is not set+# CONFIG_IKCONFIG is not set+# CONFIG_RELAY is not set+CONFIG_INITRAMFS_SOURCE=""+CONFIG_CC_OPTIMIZE_FOR_SIZE=y+# CONFIG_EMBEDDED is not set+CONFIG_UID16=y+CONFIG_SYSCTL=y+CONFIG_KALLSYMS=y+# CONFIG_KALLSYMS_ALL is not set+# CONFIG_KALLSYMS_EXTRA_PASS is not set+CONFIG_HOTPLUG=y+CONFIG_PRINTK=y+CONFIG_BUG=y+CONFIG_ELF_CORE=y+CONFIG_BASE_FULL=y+CONFIG_FUTEX=y+CONFIG_EPOLL=y+CONFIG_SHMEM=y+CONFIG_SLAB=y+CONFIG_VM_EVENT_COUNTERS=y+CONFIG_RT_MUTEXES=y+# CONFIG_TINY_SHMEM is not set+CONFIG_BASE_SMALL=0+# CONFIG_SLOB is not set++#+# Loadable module support+#+CONFIG_MODULES=y+CONFIG_MODULE_UNLOAD=y+CONFIG_MODULE_FORCE_UNLOAD=y+# CONFIG_MODVERSIONS is not set+# CONFIG_MODULE_SRCVERSION_ALL is not set+CONFIG_KMOD=y++#+# Block layer+#+# CONFIG_BLK_DEV_IO_TRACE is not set++#+# IO Schedulers+#+CONFIG_IOSCHED_NOOP=y+CONFIG_IOSCHED_AS=y+CONFIG_IOSCHED_DEADLINE=y+CONFIG_IOSCHED_CFQ=y+CONFIG_DEFAULT_AS=y+# CONFIG_DEFAULT_DEADLINE is not set+# CONFIG_DEFAULT_CFQ is not set+# CONFIG_DEFAULT_NOOP is not set+CONFIG_DEFAULT_IOSCHED="anticipatory"++#+# System Type+#+# CONFIG_ARCH_AAEC2000 is not set+# CONFIG_ARCH_INTEGRATOR is not set+# CONFIG_ARCH_REALVIEW is not set+# CONFIG_ARCH_VERSATILE is not set+# CONFIG_ARCH_AT91 is not set+# CONFIG_ARCH_CLPS7500 is not set+# CONFIG_ARCH_CLPS711X is not set+# CONFIG_ARCH_CO285 is not set+# CONFIG_ARCH_EBSA110 is not set+# CONFIG_ARCH_EP93XX is not set+# CONFIG_ARCH_FOOTBRIDGE is not set+# CONFIG_ARCH_NETX is not set+# CONFIG_ARCH_H720X is not set+# CONFIG_ARCH_IMX is not set+# CONFIG_ARCH_IOP3XX is not set+# CONFIG_ARCH_IXP4XX is not set+# CONFIG_ARCH_IXP2000 is not set+# CONFIG_ARCH_IXP23XX is not set+# CONFIG_ARCH_L7200 is not set+# CONFIG_ARCH_PNX4008 is not set+# CONFIG_ARCH_PXA is not set+# CONFIG_ARCH_RPC is not set+# CONFIG_ARCH_SA1100 is not set+# CONFIG_ARCH_S3C2410 is not set+# CONFIG_ARCH_SHARK is not set+# CONFIG_ARCH_LH7A40X is not set+CONFIG_ARCH_OMAP=y++#+# TI OMAP Implementations+#+CONFIG_ARCH_OMAP1=y+# CONFIG_ARCH_OMAP2 is not set++#+# OMAP Feature Selections+#+# CONFIG_OMAP_RESET_CLOCKS is not set+# CONFIG_OMAP_BOOT_TAG is not set+# CONFIG_OMAP_GPIO_SWITCH is not set+CONFIG_OMAP_MUX=y+# CONFIG_OMAP_MUX_DEBUG is not set+CONFIG_OMAP_MUX_WARNINGS=y+CONFIG_OMAP_MCBSP=y+CONFIG_OMAP_MPU_TIMER=y+# CONFIG_OMAP_32K_TIMER is not set+CONFIG_OMAP_LL_DEBUG_UART1=y+# CONFIG_OMAP_LL_DEBUG_UART2 is not set+# CONFIG_OMAP_LL_DEBUG_UART3 is not set+CONFIG_OMAP_SERIAL_WAKE=y+CONFIG_OMAP_DSP=m+# CONFIG_OMAP_DSP_MBCMD_VERBOSE is not set+# CONFIG_OMAP_DSP_TASK_MULTIOPEN is not set+# CONFIG_OMAP_DSP_FBEXPORT is not set
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -