Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_FB_H_
3#define _ASM_FB_H_
4
5#include <asm/page.h>
6#include <asm/setup.h>
7
8static inline pgprot_t pgprot_framebuffer(pgprot_t prot,
9 unsigned long vm_start, unsigned long vm_end,
10 unsigned long offset)
11{
12#ifdef CONFIG_MMU
13#ifdef CONFIG_SUN3
14 pgprot_val(prot) |= SUN3_PAGE_NOCACHE;
15#else
16 if (CPU_IS_020_OR_030)
17 pgprot_val(prot) |= _PAGE_NOCACHE030;
18 if (CPU_IS_040_OR_060) {
19 pgprot_val(prot) &= _CACHEMASK040;
20 /* Use no-cache mode, serialized */
21 pgprot_val(prot) |= _PAGE_NOCACHE_S;
22 }
23#endif /* CONFIG_SUN3 */
24#endif /* CONFIG_MMU */
25
26 return prot;
27}
28#define pgprot_framebuffer pgprot_framebuffer
29
30#include <asm-generic/fb.h>
31
32#endif /* _ASM_FB_H_ */
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_FB_H_
3#define _ASM_FB_H_
4
5#include <linux/fb.h>
6#include <linux/fs.h>
7#include <asm/page.h>
8#include <asm/setup.h>
9
10#ifdef CONFIG_MMU
11#ifdef CONFIG_SUN3
12static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
13 unsigned long off)
14{
15 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
16}
17#else
18static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
19 unsigned long off)
20{
21 if (CPU_IS_020_OR_030)
22 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
23 if (CPU_IS_040_OR_060) {
24 pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
25 /* Use no-cache mode, serialized */
26 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
27 }
28}
29#endif /* CONFIG_SUN3 */
30#else
31#define fb_pgprotect(...) do {} while (0)
32#endif /* CONFIG_MMU */
33
34static inline int fb_is_primary_device(struct fb_info *info)
35{
36 return 0;
37}
38
39#endif /* _ASM_FB_H_ */