18c2ecf20Sopenharmony_ci========================== 28c2ecf20Sopenharmony_ciS3C24XX ARM Linux Overview 38c2ecf20Sopenharmony_ci========================== 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciIntroduction 88c2ecf20Sopenharmony_ci------------ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported 118c2ecf20Sopenharmony_ci by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, 128c2ecf20Sopenharmony_ci S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 and S3C2450 devices 138c2ecf20Sopenharmony_ci are supported. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci Support for the S3C2400 and S3C24A0 series was never completed and the 168c2ecf20Sopenharmony_ci corresponding code has been removed after a while. If someone wishes to 178c2ecf20Sopenharmony_ci revive this effort, partial support can be retrieved from earlier Linux 188c2ecf20Sopenharmony_ci versions. 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci The S3C2416 and S3C2450 devices are very similar and S3C2450 support is 218c2ecf20Sopenharmony_ci included under the arch/arm/mach-s3c2416 directory. Note, while core 228c2ecf20Sopenharmony_ci support for these SoCs is in, work on some of the extra peripherals 238c2ecf20Sopenharmony_ci and extra interrupts is still ongoing. 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciConfiguration 278c2ecf20Sopenharmony_ci------------- 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci A generic S3C2410 configuration is provided, and can be used as the 308c2ecf20Sopenharmony_ci default by `make s3c2410_defconfig`. This configuration has support 318c2ecf20Sopenharmony_ci for all the machines, and the commonly used features on them. 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci Certain machines may have their own default configurations as well, 348c2ecf20Sopenharmony_ci please check the machine specific documentation. 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciLayout 388c2ecf20Sopenharmony_ci------ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci The core support files are located in the platform code contained in 418c2ecf20Sopenharmony_ci arch/arm/plat-s3c24xx with headers in include/asm-arm/plat-s3c24xx. 428c2ecf20Sopenharmony_ci This directory should be kept to items shared between the platform 438c2ecf20Sopenharmony_ci code (arch/arm/plat-s3c24xx) and the arch/arm/mach-s3c24* code. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci Each cpu has a directory with the support files for it, and the 468c2ecf20Sopenharmony_ci machines that carry the device. For example S3C2410 is contained 478c2ecf20Sopenharmony_ci in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci Register, kernel and platform data definitions are held in the 508c2ecf20Sopenharmony_ci arch/arm/mach-s3c2410 directory./include/mach 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ciarch/arm/plat-s3c24xx: 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci Files in here are either common to all the s3c24xx family, 558c2ecf20Sopenharmony_ci or are common to only some of them with names to indicate this 568c2ecf20Sopenharmony_ci status. The files that are not common to all are generally named 578c2ecf20Sopenharmony_ci with the initial cpu they support in the series to ensure a short 588c2ecf20Sopenharmony_ci name without any possibility of confusion with newer devices. 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci As an example, initially s3c244x would cover s3c2440 and s3c2442, but 618c2ecf20Sopenharmony_ci with the s3c2443 which does not share many of the same drivers in 628c2ecf20Sopenharmony_ci this directory, the name becomes invalid. We stick to s3c2440-<x> 638c2ecf20Sopenharmony_ci to indicate a driver that is s3c2440 and s3c2442 compatible. 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci This does mean that to find the status of any given SoC, a number 668c2ecf20Sopenharmony_ci of directories may need to be searched. 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciMachines 708c2ecf20Sopenharmony_ci-------- 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci The currently supported machines are as follows: 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci Simtec Electronics EB2410ITX (BAST) 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci A general purpose development board, see EB2410ITX.txt for further 778c2ecf20Sopenharmony_ci details 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci Simtec Electronics IM2440D20 (Osiris) 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci CPU Module from Simtec Electronics, with a S3C2440A CPU, nand flash 828c2ecf20Sopenharmony_ci and a PCMCIA controller. 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci Samsung SMDK2410 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci Samsung's own development board, geared for PDA work. 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci Samsung/Aiji SMDK2412 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci The S3C2412 version of the SMDK2440. 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci Samsung/Aiji SMDK2413 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci The S3C2412 version of the SMDK2440. 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci Samsung/Meritech SMDK2440 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci The S3C2440 compatible version of the SMDK2440, which has the 998c2ecf20Sopenharmony_ci option of an S3C2440 or S3C2442 CPU module. 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci Thorcom VR1000 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci Custom embedded board 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci HP IPAQ 1940 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci Handheld (IPAQ), available in several varieties 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci HP iPAQ rx3715 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci S3C2440 based IPAQ, with a number of variations depending on 1128c2ecf20Sopenharmony_ci features shipped. 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci Acer N30 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci A S3C2410 based PDA from Acer. There is a Wiki page at 1178c2ecf20Sopenharmony_ci http://handhelds.org/moin/moin.cgi/AcerN30Documentation . 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci AML M5900 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci American Microsystems' M5900 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci Nex Vision Nexcoder 1248c2ecf20Sopenharmony_ci Nex Vision Otom 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci Two machines by Nex Vision 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ciAdding New Machines 1308c2ecf20Sopenharmony_ci------------------- 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci The architecture has been designed to support as many machines as can 1338c2ecf20Sopenharmony_ci be configured for it in one kernel build, and any future additions 1348c2ecf20Sopenharmony_ci should keep this in mind before altering items outside of their own 1358c2ecf20Sopenharmony_ci machine files. 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci Machine definitions should be kept in linux/arch/arm/mach-s3c2410, 1388c2ecf20Sopenharmony_ci and there are a number of examples that can be looked at. 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci Read the kernel patch submission policies as well as the 1418c2ecf20Sopenharmony_ci Documentation/arm directory before submitting patches. The 1428c2ecf20Sopenharmony_ci ARM kernel series is managed by Russell King, and has a patch system 1438c2ecf20Sopenharmony_ci located at http://www.arm.linux.org.uk/developer/patches/ 1448c2ecf20Sopenharmony_ci as well as mailing lists that can be found from the same site. 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci As a courtesy, please notify <ben-linux@fluff.org> of any new 1478c2ecf20Sopenharmony_ci machines or other modifications. 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_ci Any large scale modifications, or new drivers should be discussed 1508c2ecf20Sopenharmony_ci on the ARM kernel mailing list (linux-arm-kernel) before being 1518c2ecf20Sopenharmony_ci attempted. See http://www.arm.linux.org.uk/mailinglists/ for the 1528c2ecf20Sopenharmony_ci mailing list information. 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ciI2C 1568c2ecf20Sopenharmony_ci--- 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci The hardware I2C core in the CPU is supported in single master 1598c2ecf20Sopenharmony_ci mode, and can be configured via platform data. 1608c2ecf20Sopenharmony_ci 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ciRTC 1638c2ecf20Sopenharmony_ci--- 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci Support for the onboard RTC unit, including alarm function. 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci This has recently been upgraded to use the new RTC core, 1688c2ecf20Sopenharmony_ci and the module has been renamed to rtc-s3c to fit in with 1698c2ecf20Sopenharmony_ci the new rtc naming scheme. 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ciWatchdog 1738c2ecf20Sopenharmony_ci-------- 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci The onchip watchdog is available via the standard watchdog 1768c2ecf20Sopenharmony_ci interface. 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ciNAND 1808c2ecf20Sopenharmony_ci---- 1818c2ecf20Sopenharmony_ci 1828c2ecf20Sopenharmony_ci The current kernels now have support for the s3c2410 NAND 1838c2ecf20Sopenharmony_ci controller. If there are any problems the latest linux-mtd 1848c2ecf20Sopenharmony_ci code can be found from http://www.linux-mtd.infradead.org/ 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci For more information see Documentation/arm/samsung-s3c24xx/nand.rst 1878c2ecf20Sopenharmony_ci 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ciSD/MMC 1908c2ecf20Sopenharmony_ci------ 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ci The SD/MMC hardware pre S3C2443 is supported in the current 1938c2ecf20Sopenharmony_ci kernel, the driver is drivers/mmc/host/s3cmci.c and supports 1948c2ecf20Sopenharmony_ci 1 and 4 bit SD or MMC cards. 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci The SDIO behaviour of this driver has not been fully tested. There is no 1978c2ecf20Sopenharmony_ci current support for hardware SDIO interrupts. 1988c2ecf20Sopenharmony_ci 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ciSerial 2018c2ecf20Sopenharmony_ci------ 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ci The s3c2410 serial driver provides support for the internal 2048c2ecf20Sopenharmony_ci serial ports. These devices appear as /dev/ttySAC0 through 3. 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ci To create device nodes for these, use the following commands 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci mknod ttySAC0 c 204 64 2098c2ecf20Sopenharmony_ci mknod ttySAC1 c 204 65 2108c2ecf20Sopenharmony_ci mknod ttySAC2 c 204 66 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ciGPIO 2148c2ecf20Sopenharmony_ci---- 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci The core contains support for manipulating the GPIO, see the 2178c2ecf20Sopenharmony_ci documentation in GPIO.txt in the same directory as this file. 2188c2ecf20Sopenharmony_ci 2198c2ecf20Sopenharmony_ci Newer kernels carry GPIOLIB, and support is being moved towards 2208c2ecf20Sopenharmony_ci this with some of the older support in line to be removed. 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_ci As of v2.6.34, the move towards using gpiolib support is almost 2238c2ecf20Sopenharmony_ci complete, and very little of the old calls are left. 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_ci See Documentation/arm/samsung-s3c24xx/gpio.rst for the S3C24XX specific 2268c2ecf20Sopenharmony_ci support and Documentation/arm/samsung/gpio.rst for the core Samsung 2278c2ecf20Sopenharmony_ci implementation. 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ciClock Management 2318c2ecf20Sopenharmony_ci---------------- 2328c2ecf20Sopenharmony_ci 2338c2ecf20Sopenharmony_ci The core provides the interface defined in the header file 2348c2ecf20Sopenharmony_ci include/asm-arm/hardware/clock.h, to allow control over the 2358c2ecf20Sopenharmony_ci various clock units 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ciSuspend to RAM 2398c2ecf20Sopenharmony_ci-------------- 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_ci For boards that provide support for suspend to RAM, the 2428c2ecf20Sopenharmony_ci system can be placed into low power suspend. 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ci See Suspend.txt for more information. 2458c2ecf20Sopenharmony_ci 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ciSPI 2488c2ecf20Sopenharmony_ci--- 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci SPI drivers are available for both the in-built hardware 2518c2ecf20Sopenharmony_ci (although there is no DMA support yet) and a generic 2528c2ecf20Sopenharmony_ci GPIO based solution. 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_ciLEDs 2568c2ecf20Sopenharmony_ci---- 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci There is support for GPIO based LEDs via a platform driver 2598c2ecf20Sopenharmony_ci in the LED subsystem. 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ciPlatform Data 2638c2ecf20Sopenharmony_ci------------- 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci Whenever a device has platform specific data that is specified 2668c2ecf20Sopenharmony_ci on a per-machine basis, care should be taken to ensure the 2678c2ecf20Sopenharmony_ci following: 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci 1) that default data is not left in the device to confuse the 2708c2ecf20Sopenharmony_ci driver if a machine does not set it at startup 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci 2) the data should (if possible) be marked as __initdata, 2738c2ecf20Sopenharmony_ci to ensure that the data is thrown away if the machine is 2748c2ecf20Sopenharmony_ci not the one currently in use. 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ci The best way of doing this is to make a function that 2778c2ecf20Sopenharmony_ci kmalloc()s an area of memory, and copies the __initdata 2788c2ecf20Sopenharmony_ci and then sets the relevant device's platform data. Making 2798c2ecf20Sopenharmony_ci the function `__init` takes care of ensuring it is discarded 2808c2ecf20Sopenharmony_ci with the rest of the initialisation code:: 2818c2ecf20Sopenharmony_ci 2828c2ecf20Sopenharmony_ci static __init void s3c24xx_xxx_set_platdata(struct xxx_data *pd) 2838c2ecf20Sopenharmony_ci { 2848c2ecf20Sopenharmony_ci struct s3c2410_xxx_mach_info *npd; 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci npd = kmalloc(sizeof(struct s3c2410_xxx_mach_info), GFP_KERNEL); 2878c2ecf20Sopenharmony_ci if (npd) { 2888c2ecf20Sopenharmony_ci memcpy(npd, pd, sizeof(struct s3c2410_xxx_mach_info)); 2898c2ecf20Sopenharmony_ci s3c_device_xxx.dev.platform_data = npd; 2908c2ecf20Sopenharmony_ci } else { 2918c2ecf20Sopenharmony_ci printk(KERN_ERR "no memory for xxx platform data\n"); 2928c2ecf20Sopenharmony_ci } 2938c2ecf20Sopenharmony_ci } 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci Note, since the code is marked as __init, it should not be 2968c2ecf20Sopenharmony_ci exported outside arch/arm/mach-s3c2410/, or exported to 2978c2ecf20Sopenharmony_ci modules via EXPORT_SYMBOL() and related functions. 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_ci 3008c2ecf20Sopenharmony_ciPort Contributors 3018c2ecf20Sopenharmony_ci----------------- 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci Ben Dooks (BJD) 3048c2ecf20Sopenharmony_ci Vincent Sanders 3058c2ecf20Sopenharmony_ci Herbert Potzl 3068c2ecf20Sopenharmony_ci Arnaud Patard (RTP) 3078c2ecf20Sopenharmony_ci Roc Wu 3088c2ecf20Sopenharmony_ci Klaus Fetscher 3098c2ecf20Sopenharmony_ci Dimitry Andric 3108c2ecf20Sopenharmony_ci Shannon Holland 3118c2ecf20Sopenharmony_ci Guillaume Gourat (NexVision) 3128c2ecf20Sopenharmony_ci Christer Weinigel (wingel) (Acer N30) 3138c2ecf20Sopenharmony_ci Lucas Correia Villa Real (S3C2400 port) 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ciDocument Author 3178c2ecf20Sopenharmony_ci--------------- 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ciBen Dooks, Copyright 2004-2006 Simtec Electronics 320