Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
9ddabb6
Documentation
arch
alpha
arm
boot
common
configs
include
kernel
lib
mach-aaec2000
mach-at91
mach-bcmring
mach-clps711x
mach-davinci
mach-dove
mach-ebsa110
mach-ep93xx
mach-footbridge
mach-gemini
mach-h720x
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp2000
mach-ixp23xx
mach-ixp4xx
mach-kirkwood
mach-ks8695
mach-l7200
mach-lh7a40x
mach-loki
mach-mmp
mach-msm
mach-mv78xx0
mach-mx1
mach-mx2
mach-mx25
mach-mx3
mach-mxc91231
mach-netx
mach-nomadik
mach-ns9xxx
mach-omap1
mach-omap2
mach-orion5x
mach-pnx4008
mach-pxa
mach-realview
mach-rpc
mach-s3c2400
mach-s3c2410
mach-s3c2412
mach-s3c2440
mach-s3c2442
mach-s3c2443
mach-s3c24a0
mach-s3c6400
mach-s3c6410
mach-s5pc100
mach-sa1100
mach-shark
mach-stmp378x
mach-stmp37xx
mach-u300
mach-ux500
mach-versatile
mach-w90x900
mm
nwfpe
oprofile
plat-iop
plat-mxc
plat-nomadik
plat-omap
plat-orion
plat-pxa
plat-s3c
include
Kconfig
Makefile
clock.c
dev-fb.c
dev-hsmmc.c
dev-hsmmc1.c
dev-hsmmc2.c
dev-i2c0.c
dev-i2c1.c
dev-nand.c
dev-usb-hsotg.c
dev-usb.c
dma.c
gpio-config.c
gpio.c
init.c
pm-check.c
pm-gpio.c
pm.c
pwm-clock.c
pwm.c
time.c
plat-s3c24xx
plat-s3c64xx
plat-s5pc1xx
plat-samsung
plat-stmp3xxx
tools
vfp
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile
avr32
blackfin
cris
frv
h8300
ia64
m32r
m68k
m68knommu
microblaze
mips
mn10300
parisc
powerpc
s390
score
sh
sparc
um
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm
/
plat-s3c
/
dev-nand.c
Copy path
Blame
Blame
Latest commit
History
History
129 lines (105 loc) · 2.97 KB
Breadcrumbs
linux
/
arch
/
arm
/
plat-s3c
/
dev-nand.c
Top
File metadata and controls
Code
Blame
129 lines (105 loc) · 2.97 KB
Raw
/* * S3C series device definition for nand device * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <mach/map.h> #include <plat/devs.h> #include <plat/nand.h> static struct resource s3c_nand_resource[] = { [0] = { .start = S3C_PA_NAND, .end = S3C_PA_NAND + SZ_1M, .flags = IORESOURCE_MEM, } }; struct platform_device s3c_device_nand = { .name = "s3c2410-nand", .id = -1, .num_resources = ARRAY_SIZE(s3c_nand_resource), .resource = s3c_nand_resource, }; EXPORT_SYMBOL(s3c_device_nand); /** * s3c_nand_copy_set() - copy nand set data * @set: The new structure, directly copied from the old. * * Copy all the fields from the NAND set field from what is probably __initdata * to new kernel memory. The code returns 0 if the copy happened correctly or * an error code for the calling function to display. * * Note, we currently do not try and look to see if we've already copied the * data in a previous set. */ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set) { void *ptr; int size; size = sizeof(struct mtd_partition) * set->nr_partitions; if (size) { ptr = kmemdup(set->partitions, size, GFP_KERNEL); set->partitions = ptr; if (!ptr) return -ENOMEM; } if (set->nr_map && set->nr_chips) { size = sizeof(int) * set->nr_chips; ptr = kmemdup(set->nr_map, size, GFP_KERNEL); set->nr_map = ptr; if (!ptr) return -ENOMEM; } if (set->ecc_layout) { ptr = kmemdup(set->ecc_layout, sizeof(struct nand_ecclayout), GFP_KERNEL); set->ecc_layout = ptr; if (!ptr) return -ENOMEM; } return 0; } void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) { struct s3c2410_platform_nand *npd; int size; int ret; /* note, if we get a failure in allocation, we simply drop out of the * function. If there is so little memory available at initialisation * time then there is little chance the system is going to run. */ npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL); if (!npd) { printk(KERN_ERR "%s: failed copying platform data\n", __func__); return; } /* now see if we need to copy any of the nand set data */ size = sizeof(struct s3c2410_nand_set) * npd->nr_sets; if (size) { struct s3c2410_nand_set *from = npd->sets; struct s3c2410_nand_set *to; int i; to = kmemdup(from, size, GFP_KERNEL); npd->sets = to; /* set, even if we failed */ if (!to) { printk(KERN_ERR "%s: no memory for sets\n", __func__); return; } for (i = 0; i < npd->nr_sets; i++) { ret = s3c_nand_copy_set(to); if (ret) { printk(KERN_ERR "%s: failed to copy set %d\n", __func__, i); return; } to++; } } s3c_device_nand.dev.platform_data = npd; } EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
You can’t perform that action at this time.