SlideShare a Scribd company logo
How to write Platform Devices and Drivers with FPGA via GPMC Bo-Yi Wu 2011.06.15 http://blog.wu-boy.com
What’s GPMC 全名  General-Purpose Memory Controller the device unified memory controller (UMC) dedicated to interfacing external memory devices. NAND Flash NOR Flash FPGA (*) 如果要更深入研究,請參考  TI  線上  Documentation
寫  GPMC Drive  跟  FPGA  溝通前
必須先瞭解什麼是  Platform Devices  和  Platform  Drivers
撰寫  Driver Model  事先預備   Porting Drivers to New Driver Model Driver Binding Bus Types Device Classes Basic Device Structure Managed Device Resource Device Drivers Device Interfaces Platform Devices and Drivers
Platform  架構 參考  <linux/platform_device.h>  來瞭解  driver model  如何跟  platform bus  溝通 用在  system-on-chip processors  或者是一些  &quot;legacy&quot; PC interconnects
Platform devices 請指定一個名稱用來  Driver Binding ,以及定義該  Devices  需要用到的  addresses  和  IRQs. struct  platform_device  { const char *name; u32 id; struct device dev; u32 num_resources; struct resource *resource; };
Platform drivers Platform drivers  走  Driver Model  標準規範,提供  probe  及  remove method ,它們提供  power  管理及關閉提醒等標準
struct  platform_driver  { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*suspend_late)(struct platform_device *, pm_message_t state); int (*resume_early)(struct platform_device *); int (*resume)(struct platform_device *); struct device_driver driver; };
Probe  用來偵測特定  Hardware  是否存在,及使用該裝置資源  (clocks  和  device platform_data) 透過底下函式來註冊  Driver int platform_driver_register(struct platform_driver *drv); 過去  Legacy  Driver  並不會完全遵守標準 driver model ,這些 driver 會去註冊自己的 platform device ,而不是讓系統來完成註冊
裝置初始化 在大多數的  Platform  設備都必須先註冊  Platform Device 定義  platform_data, resource,  共有多少個  resource  等等 platform_device_register platform_add_devices
Device Naming  和  Driver Binding  platform_device.dev.bus_id  是一個  device id  分為兩個  component: platform_device.name  用來跟  Driver match platform_device.id  裝置編號順序 ( 例如假設有支援多個  NAND  或  NOR Flash) ,如果設定為  -1  表示為獨一無二的裝置
Driver binding 在  Driver Core  裡面透過  probe  自動匹對 利用  Device Name and ID  去  match name/id: gpmc_bus.1  或  gpmc_bus
board-omap3evm GPMC Device Init Match Driver name  GPMC Driver Init GPMC Address IRQ GPMC Clock and Chip Select Define
GPMC support functions gpmc_cs_read_reg gpmc_cs_write_reg Please referrer  arch/arm/mach-omap2/gpmc.c
GPMC Address Mapping
Supported Devices .GPMC_CONFIG1_i[11:10] Access Size Adaptation and Device Width .GPMC_CONFIG1_i[13:12]
Timing Setting
上面兩張設定如果設定正確,就可以正確看到波形,如果設定錯誤,請準備接收  Kernel Panic
結論 Platform Device  和  Platform Driver  區別? GPMC Config_[1-7]  設定方式及規範 實際參考  NAND Driver  程式

More Related Content

PDF
[嵌入式系統] MCS-51 實驗 - 使用 IAR (1)
PPTX
艾鍗學院-單晶片韌體開發- LCM模組實驗
PDF
Arduino Yún使用Http restful api控制io
PDF
Arduino AMA中級認證術科實作 all
PDF
[嵌入式系統] 嵌入式系統進階
PDF
Arduino overview
PDF
Arduino序列通訊
PDF
nodeMCU IOT教學03 - NodeMCU導論
[嵌入式系統] MCS-51 實驗 - 使用 IAR (1)
艾鍗學院-單晶片韌體開發- LCM模組實驗
Arduino Yún使用Http restful api控制io
Arduino AMA中級認證術科實作 all
[嵌入式系統] 嵌入式系統進階
Arduino overview
Arduino序列通訊
nodeMCU IOT教學03 - NodeMCU導論

What's hot (20)

PDF
Arduino基礎IO控制
PDF
[ZigBee 嵌入式系統] ZigBee Architecture 與 TI Z-Stack Firmware
PPTX
艾鍗學院-單晶片韌體-CC2500通訊實驗
PDF
Arduino程式快速入門
PDF
Arduino程式快速入門
PPTX
2018 VLSI/CAD Symposium Tutorial (Aug. 7, 20:00-21:00 Room 3F-VII)
PPTX
Raspberry Pi 溫濕度發報機
PDF
Sy03091说明书
DOC
嵌入式inux應用專題文件-智慧家庭系統
PDF
Arduino序列通訊應用
PDF
MicroPython簡介
PPT
認識 RoBoard 硬體
PDF
使用 Arduino 控制 ESP8266 的各種方式
PPT
Device Driver - Chapter 3字元驅動程式
PPT
第6章 输入输出技术
PPTX
Ch2 2
PDF
Arduino 底層原始碼解析心得
PDF
Arduino感測應用
PPTX
Arduino 與 raspberry pi 硬體差異與應用
PDF
nodeMCU IOT教學02 - Lua語言
Arduino基礎IO控制
[ZigBee 嵌入式系統] ZigBee Architecture 與 TI Z-Stack Firmware
艾鍗學院-單晶片韌體-CC2500通訊實驗
Arduino程式快速入門
Arduino程式快速入門
2018 VLSI/CAD Symposium Tutorial (Aug. 7, 20:00-21:00 Room 3F-VII)
Raspberry Pi 溫濕度發報機
Sy03091说明书
嵌入式inux應用專題文件-智慧家庭系統
Arduino序列通訊應用
MicroPython簡介
認識 RoBoard 硬體
使用 Arduino 控制 ESP8266 的各種方式
Device Driver - Chapter 3字元驅動程式
第6章 输入输出技术
Ch2 2
Arduino 底層原始碼解析心得
Arduino感測應用
Arduino 與 raspberry pi 硬體差異與應用
nodeMCU IOT教學02 - Lua語言
Ad

Similar to How to write Platform Devices and Drivers with FPGA via GPMC (20)

PPT
0118 Windows Server 2008 的伺服器核心 (Server Core)
PPT
第11讲 管理Cisco互联网络
DOC
Kick start无人值守批量安装linux
DOC
尚观Linux研究室 linux驱动程序全解析
PPT
Ch2 4
PDF
Baidu Cloud Foundry
PDF
Framebuffer
PPT
部門會議 950619 Leon的錦囊妙計
PPTX
OpenRISC whsap
PPT
MySQL新技术探索与实践
PPT
實作 Linux Driver 移植在樹莓 Pi 上:Linux One wire sensor & I2C framebuffer Driver Po...
PPT
Cuda基本介绍
PPT
南投替代役整理組數位典藏報告
PDF
Windows Mobile 6 遊戲開發入門
PDF
Inside Erlang Vm II
DOC
Oraliux+mysql5单机多实例安装文档
PPT
在雲端上啜飲爪哇
PDF
C/C++调试、跟踪及性能分析工具综述
PPT
构建ActionScript游戏服务器,支持超过15000并发连接
PPT
Aix操作系统培训文档
0118 Windows Server 2008 的伺服器核心 (Server Core)
第11讲 管理Cisco互联网络
Kick start无人值守批量安装linux
尚观Linux研究室 linux驱动程序全解析
Ch2 4
Baidu Cloud Foundry
Framebuffer
部門會議 950619 Leon的錦囊妙計
OpenRISC whsap
MySQL新技术探索与实践
實作 Linux Driver 移植在樹莓 Pi 上:Linux One wire sensor & I2C framebuffer Driver Po...
Cuda基本介绍
南投替代役整理組數位典藏報告
Windows Mobile 6 遊戲開發入門
Inside Erlang Vm II
Oraliux+mysql5单机多实例安装文档
在雲端上啜飲爪哇
C/C++调试、跟踪及性能分析工具综述
构建ActionScript游戏服务器,支持超过15000并发连接
Aix操作系统培训文档
Ad

More from Bo-Yi Wu (20)

PDF
Drone CI/CD 自動化測試及部署
PDF
用 Go 語言打造多台機器 Scale 架構
PDF
Job Queue in Golang
PDF
Golang Project Layout and Practice
PDF
Introduction to GitHub Actions
PDF
Drone 1.0 Feature
PDF
Drone CI/CD Platform
PDF
GraphQL IN Golang
PPTX
Go 語言基礎簡介
PPTX
drone continuous Integration
PPTX
Gorush: A push notification server written in Go
PPTX
用 Drone 打造 輕量級容器持續交付平台
PPTX
用 Go 語言 打造微服務架構
PPTX
Introduction to Gitea with Drone
PDF
運用 Docker 整合 Laravel 提升團隊開發效率
PDF
用 Go 語言實戰 Push Notification 服務
PPTX
用 Go 語言打造 DevOps Bot
PPTX
A painless self-hosted Git service: Gitea
PPTX
Write microservice in golang
PPTX
用 Docker 改善團隊合作模式
Drone CI/CD 自動化測試及部署
用 Go 語言打造多台機器 Scale 架構
Job Queue in Golang
Golang Project Layout and Practice
Introduction to GitHub Actions
Drone 1.0 Feature
Drone CI/CD Platform
GraphQL IN Golang
Go 語言基礎簡介
drone continuous Integration
Gorush: A push notification server written in Go
用 Drone 打造 輕量級容器持續交付平台
用 Go 語言 打造微服務架構
Introduction to Gitea with Drone
運用 Docker 整合 Laravel 提升團隊開發效率
用 Go 語言實戰 Push Notification 服務
用 Go 語言打造 DevOps Bot
A painless self-hosted Git service: Gitea
Write microservice in golang
用 Docker 改善團隊合作模式

How to write Platform Devices and Drivers with FPGA via GPMC

  • 1. How to write Platform Devices and Drivers with FPGA via GPMC Bo-Yi Wu 2011.06.15 http://blog.wu-boy.com
  • 2. What’s GPMC 全名 General-Purpose Memory Controller the device unified memory controller (UMC) dedicated to interfacing external memory devices. NAND Flash NOR Flash FPGA (*) 如果要更深入研究,請參考 TI 線上 Documentation
  • 3. 寫 GPMC Drive 跟 FPGA 溝通前
  • 4. 必須先瞭解什麼是 Platform Devices 和 Platform Drivers
  • 5. 撰寫 Driver Model 事先預備 Porting Drivers to New Driver Model Driver Binding Bus Types Device Classes Basic Device Structure Managed Device Resource Device Drivers Device Interfaces Platform Devices and Drivers
  • 6. Platform 架構 參考 <linux/platform_device.h> 來瞭解 driver model 如何跟 platform bus 溝通 用在 system-on-chip processors 或者是一些 &quot;legacy&quot; PC interconnects
  • 7. Platform devices 請指定一個名稱用來 Driver Binding ,以及定義該 Devices 需要用到的 addresses 和 IRQs. struct platform_device { const char *name; u32 id; struct device dev; u32 num_resources; struct resource *resource; };
  • 8. Platform drivers Platform drivers 走 Driver Model 標準規範,提供 probe 及 remove method ,它們提供 power 管理及關閉提醒等標準
  • 9. struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*suspend_late)(struct platform_device *, pm_message_t state); int (*resume_early)(struct platform_device *); int (*resume)(struct platform_device *); struct device_driver driver; };
  • 10. Probe 用來偵測特定 Hardware 是否存在,及使用該裝置資源 (clocks 和 device platform_data) 透過底下函式來註冊 Driver int platform_driver_register(struct platform_driver *drv); 過去 Legacy Driver 並不會完全遵守標準 driver model ,這些 driver 會去註冊自己的 platform device ,而不是讓系統來完成註冊
  • 11. 裝置初始化 在大多數的 Platform 設備都必須先註冊 Platform Device 定義 platform_data, resource, 共有多少個 resource 等等 platform_device_register platform_add_devices
  • 12. Device Naming 和 Driver Binding platform_device.dev.bus_id 是一個 device id 分為兩個 component: platform_device.name 用來跟 Driver match platform_device.id 裝置編號順序 ( 例如假設有支援多個 NAND 或 NOR Flash) ,如果設定為 -1 表示為獨一無二的裝置
  • 13. Driver binding 在 Driver Core 裡面透過 probe 自動匹對 利用 Device Name and ID 去 match name/id: gpmc_bus.1 或 gpmc_bus
  • 14. board-omap3evm GPMC Device Init Match Driver name GPMC Driver Init GPMC Address IRQ GPMC Clock and Chip Select Define
  • 15. GPMC support functions gpmc_cs_read_reg gpmc_cs_write_reg Please referrer arch/arm/mach-omap2/gpmc.c
  • 17. Supported Devices .GPMC_CONFIG1_i[11:10] Access Size Adaptation and Device Width .GPMC_CONFIG1_i[13:12]
  • 20. 結論 Platform Device 和 Platform Driver 區別? GPMC Config_[1-7] 設定方式及規範 實際參考 NAND Driver 程式