1*4882a593Smuzhiyun========================== 2*4882a593SmuzhiyunS3C24XX ARM Linux Overview 3*4882a593Smuzhiyun========================== 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunIntroduction 8*4882a593Smuzhiyun------------ 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported 11*4882a593Smuzhiyun by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, 12*4882a593Smuzhiyun S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 and S3C2450 devices 13*4882a593Smuzhiyun are supported. 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun Support for the S3C2400 and S3C24A0 series was never completed and the 16*4882a593Smuzhiyun corresponding code has been removed after a while. If someone wishes to 17*4882a593Smuzhiyun revive this effort, partial support can be retrieved from earlier Linux 18*4882a593Smuzhiyun versions. 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun The S3C2416 and S3C2450 devices are very similar and S3C2450 support is 21*4882a593Smuzhiyun included under the arch/arm/mach-s3c2416 directory. Note, while core 22*4882a593Smuzhiyun support for these SoCs is in, work on some of the extra peripherals 23*4882a593Smuzhiyun and extra interrupts is still ongoing. 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunConfiguration 27*4882a593Smuzhiyun------------- 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun A generic S3C2410 configuration is provided, and can be used as the 30*4882a593Smuzhiyun default by `make s3c2410_defconfig`. This configuration has support 31*4882a593Smuzhiyun for all the machines, and the commonly used features on them. 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun Certain machines may have their own default configurations as well, 34*4882a593Smuzhiyun please check the machine specific documentation. 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunLayout 38*4882a593Smuzhiyun------ 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun The core support files are located in the platform code contained in 41*4882a593Smuzhiyun arch/arm/plat-s3c24xx with headers in include/asm-arm/plat-s3c24xx. 42*4882a593Smuzhiyun This directory should be kept to items shared between the platform 43*4882a593Smuzhiyun code (arch/arm/plat-s3c24xx) and the arch/arm/mach-s3c24* code. 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun Each cpu has a directory with the support files for it, and the 46*4882a593Smuzhiyun machines that carry the device. For example S3C2410 is contained 47*4882a593Smuzhiyun in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun Register, kernel and platform data definitions are held in the 50*4882a593Smuzhiyun arch/arm/mach-s3c2410 directory./include/mach 51*4882a593Smuzhiyun 52*4882a593Smuzhiyunarch/arm/plat-s3c24xx: 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun Files in here are either common to all the s3c24xx family, 55*4882a593Smuzhiyun or are common to only some of them with names to indicate this 56*4882a593Smuzhiyun status. The files that are not common to all are generally named 57*4882a593Smuzhiyun with the initial cpu they support in the series to ensure a short 58*4882a593Smuzhiyun name without any possibility of confusion with newer devices. 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun As an example, initially s3c244x would cover s3c2440 and s3c2442, but 61*4882a593Smuzhiyun with the s3c2443 which does not share many of the same drivers in 62*4882a593Smuzhiyun this directory, the name becomes invalid. We stick to s3c2440-<x> 63*4882a593Smuzhiyun to indicate a driver that is s3c2440 and s3c2442 compatible. 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun This does mean that to find the status of any given SoC, a number 66*4882a593Smuzhiyun of directories may need to be searched. 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun 69*4882a593SmuzhiyunMachines 70*4882a593Smuzhiyun-------- 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun The currently supported machines are as follows: 73*4882a593Smuzhiyun 74*4882a593Smuzhiyun Simtec Electronics EB2410ITX (BAST) 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun A general purpose development board, see EB2410ITX.txt for further 77*4882a593Smuzhiyun details 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun Simtec Electronics IM2440D20 (Osiris) 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun CPU Module from Simtec Electronics, with a S3C2440A CPU, nand flash 82*4882a593Smuzhiyun and a PCMCIA controller. 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun Samsung SMDK2410 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun Samsung's own development board, geared for PDA work. 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun Samsung/Aiji SMDK2412 89*4882a593Smuzhiyun 90*4882a593Smuzhiyun The S3C2412 version of the SMDK2440. 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun Samsung/Aiji SMDK2413 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun The S3C2412 version of the SMDK2440. 95*4882a593Smuzhiyun 96*4882a593Smuzhiyun Samsung/Meritech SMDK2440 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun The S3C2440 compatible version of the SMDK2440, which has the 99*4882a593Smuzhiyun option of an S3C2440 or S3C2442 CPU module. 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun Thorcom VR1000 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun Custom embedded board 104*4882a593Smuzhiyun 105*4882a593Smuzhiyun HP IPAQ 1940 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun Handheld (IPAQ), available in several varieties 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun HP iPAQ rx3715 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun S3C2440 based IPAQ, with a number of variations depending on 112*4882a593Smuzhiyun features shipped. 113*4882a593Smuzhiyun 114*4882a593Smuzhiyun Acer N30 115*4882a593Smuzhiyun 116*4882a593Smuzhiyun A S3C2410 based PDA from Acer. There is a Wiki page at 117*4882a593Smuzhiyun http://handhelds.org/moin/moin.cgi/AcerN30Documentation . 118*4882a593Smuzhiyun 119*4882a593Smuzhiyun AML M5900 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun American Microsystems' M5900 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun Nex Vision Nexcoder 124*4882a593Smuzhiyun Nex Vision Otom 125*4882a593Smuzhiyun 126*4882a593Smuzhiyun Two machines by Nex Vision 127*4882a593Smuzhiyun 128*4882a593Smuzhiyun 129*4882a593SmuzhiyunAdding New Machines 130*4882a593Smuzhiyun------------------- 131*4882a593Smuzhiyun 132*4882a593Smuzhiyun The architecture has been designed to support as many machines as can 133*4882a593Smuzhiyun be configured for it in one kernel build, and any future additions 134*4882a593Smuzhiyun should keep this in mind before altering items outside of their own 135*4882a593Smuzhiyun machine files. 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun Machine definitions should be kept in linux/arch/arm/mach-s3c2410, 138*4882a593Smuzhiyun and there are a number of examples that can be looked at. 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun Read the kernel patch submission policies as well as the 141*4882a593Smuzhiyun Documentation/arm directory before submitting patches. The 142*4882a593Smuzhiyun ARM kernel series is managed by Russell King, and has a patch system 143*4882a593Smuzhiyun located at http://www.arm.linux.org.uk/developer/patches/ 144*4882a593Smuzhiyun as well as mailing lists that can be found from the same site. 145*4882a593Smuzhiyun 146*4882a593Smuzhiyun As a courtesy, please notify <ben-linux@fluff.org> of any new 147*4882a593Smuzhiyun machines or other modifications. 148*4882a593Smuzhiyun 149*4882a593Smuzhiyun Any large scale modifications, or new drivers should be discussed 150*4882a593Smuzhiyun on the ARM kernel mailing list (linux-arm-kernel) before being 151*4882a593Smuzhiyun attempted. See http://www.arm.linux.org.uk/mailinglists/ for the 152*4882a593Smuzhiyun mailing list information. 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun 155*4882a593SmuzhiyunI2C 156*4882a593Smuzhiyun--- 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun The hardware I2C core in the CPU is supported in single master 159*4882a593Smuzhiyun mode, and can be configured via platform data. 160*4882a593Smuzhiyun 161*4882a593Smuzhiyun 162*4882a593SmuzhiyunRTC 163*4882a593Smuzhiyun--- 164*4882a593Smuzhiyun 165*4882a593Smuzhiyun Support for the onboard RTC unit, including alarm function. 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun This has recently been upgraded to use the new RTC core, 168*4882a593Smuzhiyun and the module has been renamed to rtc-s3c to fit in with 169*4882a593Smuzhiyun the new rtc naming scheme. 170*4882a593Smuzhiyun 171*4882a593Smuzhiyun 172*4882a593SmuzhiyunWatchdog 173*4882a593Smuzhiyun-------- 174*4882a593Smuzhiyun 175*4882a593Smuzhiyun The onchip watchdog is available via the standard watchdog 176*4882a593Smuzhiyun interface. 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun 179*4882a593SmuzhiyunNAND 180*4882a593Smuzhiyun---- 181*4882a593Smuzhiyun 182*4882a593Smuzhiyun The current kernels now have support for the s3c2410 NAND 183*4882a593Smuzhiyun controller. If there are any problems the latest linux-mtd 184*4882a593Smuzhiyun code can be found from http://www.linux-mtd.infradead.org/ 185*4882a593Smuzhiyun 186*4882a593Smuzhiyun For more information see Documentation/arm/samsung-s3c24xx/nand.rst 187*4882a593Smuzhiyun 188*4882a593Smuzhiyun 189*4882a593SmuzhiyunSD/MMC 190*4882a593Smuzhiyun------ 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun The SD/MMC hardware pre S3C2443 is supported in the current 193*4882a593Smuzhiyun kernel, the driver is drivers/mmc/host/s3cmci.c and supports 194*4882a593Smuzhiyun 1 and 4 bit SD or MMC cards. 195*4882a593Smuzhiyun 196*4882a593Smuzhiyun The SDIO behaviour of this driver has not been fully tested. There is no 197*4882a593Smuzhiyun current support for hardware SDIO interrupts. 198*4882a593Smuzhiyun 199*4882a593Smuzhiyun 200*4882a593SmuzhiyunSerial 201*4882a593Smuzhiyun------ 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun The s3c2410 serial driver provides support for the internal 204*4882a593Smuzhiyun serial ports. These devices appear as /dev/ttySAC0 through 3. 205*4882a593Smuzhiyun 206*4882a593Smuzhiyun To create device nodes for these, use the following commands 207*4882a593Smuzhiyun 208*4882a593Smuzhiyun mknod ttySAC0 c 204 64 209*4882a593Smuzhiyun mknod ttySAC1 c 204 65 210*4882a593Smuzhiyun mknod ttySAC2 c 204 66 211*4882a593Smuzhiyun 212*4882a593Smuzhiyun 213*4882a593SmuzhiyunGPIO 214*4882a593Smuzhiyun---- 215*4882a593Smuzhiyun 216*4882a593Smuzhiyun The core contains support for manipulating the GPIO, see the 217*4882a593Smuzhiyun documentation in GPIO.txt in the same directory as this file. 218*4882a593Smuzhiyun 219*4882a593Smuzhiyun Newer kernels carry GPIOLIB, and support is being moved towards 220*4882a593Smuzhiyun this with some of the older support in line to be removed. 221*4882a593Smuzhiyun 222*4882a593Smuzhiyun As of v2.6.34, the move towards using gpiolib support is almost 223*4882a593Smuzhiyun complete, and very little of the old calls are left. 224*4882a593Smuzhiyun 225*4882a593Smuzhiyun See Documentation/arm/samsung-s3c24xx/gpio.rst for the S3C24XX specific 226*4882a593Smuzhiyun support and Documentation/arm/samsung/gpio.rst for the core Samsung 227*4882a593Smuzhiyun implementation. 228*4882a593Smuzhiyun 229*4882a593Smuzhiyun 230*4882a593SmuzhiyunClock Management 231*4882a593Smuzhiyun---------------- 232*4882a593Smuzhiyun 233*4882a593Smuzhiyun The core provides the interface defined in the header file 234*4882a593Smuzhiyun include/asm-arm/hardware/clock.h, to allow control over the 235*4882a593Smuzhiyun various clock units 236*4882a593Smuzhiyun 237*4882a593Smuzhiyun 238*4882a593SmuzhiyunSuspend to RAM 239*4882a593Smuzhiyun-------------- 240*4882a593Smuzhiyun 241*4882a593Smuzhiyun For boards that provide support for suspend to RAM, the 242*4882a593Smuzhiyun system can be placed into low power suspend. 243*4882a593Smuzhiyun 244*4882a593Smuzhiyun See Suspend.txt for more information. 245*4882a593Smuzhiyun 246*4882a593Smuzhiyun 247*4882a593SmuzhiyunSPI 248*4882a593Smuzhiyun--- 249*4882a593Smuzhiyun 250*4882a593Smuzhiyun SPI drivers are available for both the in-built hardware 251*4882a593Smuzhiyun (although there is no DMA support yet) and a generic 252*4882a593Smuzhiyun GPIO based solution. 253*4882a593Smuzhiyun 254*4882a593Smuzhiyun 255*4882a593SmuzhiyunLEDs 256*4882a593Smuzhiyun---- 257*4882a593Smuzhiyun 258*4882a593Smuzhiyun There is support for GPIO based LEDs via a platform driver 259*4882a593Smuzhiyun in the LED subsystem. 260*4882a593Smuzhiyun 261*4882a593Smuzhiyun 262*4882a593SmuzhiyunPlatform Data 263*4882a593Smuzhiyun------------- 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun Whenever a device has platform specific data that is specified 266*4882a593Smuzhiyun on a per-machine basis, care should be taken to ensure the 267*4882a593Smuzhiyun following: 268*4882a593Smuzhiyun 269*4882a593Smuzhiyun 1) that default data is not left in the device to confuse the 270*4882a593Smuzhiyun driver if a machine does not set it at startup 271*4882a593Smuzhiyun 272*4882a593Smuzhiyun 2) the data should (if possible) be marked as __initdata, 273*4882a593Smuzhiyun to ensure that the data is thrown away if the machine is 274*4882a593Smuzhiyun not the one currently in use. 275*4882a593Smuzhiyun 276*4882a593Smuzhiyun The best way of doing this is to make a function that 277*4882a593Smuzhiyun kmalloc()s an area of memory, and copies the __initdata 278*4882a593Smuzhiyun and then sets the relevant device's platform data. Making 279*4882a593Smuzhiyun the function `__init` takes care of ensuring it is discarded 280*4882a593Smuzhiyun with the rest of the initialisation code:: 281*4882a593Smuzhiyun 282*4882a593Smuzhiyun static __init void s3c24xx_xxx_set_platdata(struct xxx_data *pd) 283*4882a593Smuzhiyun { 284*4882a593Smuzhiyun struct s3c2410_xxx_mach_info *npd; 285*4882a593Smuzhiyun 286*4882a593Smuzhiyun npd = kmalloc(sizeof(struct s3c2410_xxx_mach_info), GFP_KERNEL); 287*4882a593Smuzhiyun if (npd) { 288*4882a593Smuzhiyun memcpy(npd, pd, sizeof(struct s3c2410_xxx_mach_info)); 289*4882a593Smuzhiyun s3c_device_xxx.dev.platform_data = npd; 290*4882a593Smuzhiyun } else { 291*4882a593Smuzhiyun printk(KERN_ERR "no memory for xxx platform data\n"); 292*4882a593Smuzhiyun } 293*4882a593Smuzhiyun } 294*4882a593Smuzhiyun 295*4882a593Smuzhiyun Note, since the code is marked as __init, it should not be 296*4882a593Smuzhiyun exported outside arch/arm/mach-s3c2410/, or exported to 297*4882a593Smuzhiyun modules via EXPORT_SYMBOL() and related functions. 298*4882a593Smuzhiyun 299*4882a593Smuzhiyun 300*4882a593SmuzhiyunPort Contributors 301*4882a593Smuzhiyun----------------- 302*4882a593Smuzhiyun 303*4882a593Smuzhiyun Ben Dooks (BJD) 304*4882a593Smuzhiyun Vincent Sanders 305*4882a593Smuzhiyun Herbert Potzl 306*4882a593Smuzhiyun Arnaud Patard (RTP) 307*4882a593Smuzhiyun Roc Wu 308*4882a593Smuzhiyun Klaus Fetscher 309*4882a593Smuzhiyun Dimitry Andric 310*4882a593Smuzhiyun Shannon Holland 311*4882a593Smuzhiyun Guillaume Gourat (NexVision) 312*4882a593Smuzhiyun Christer Weinigel (wingel) (Acer N30) 313*4882a593Smuzhiyun Lucas Correia Villa Real (S3C2400 port) 314*4882a593Smuzhiyun 315*4882a593Smuzhiyun 316*4882a593SmuzhiyunDocument Author 317*4882a593Smuzhiyun--------------- 318*4882a593Smuzhiyun 319*4882a593SmuzhiyunBen Dooks, Copyright 2004-2006 Simtec Electronics 320