aboutsummaryrefslogtreecommitdiffstats
path: root/docs/faq_general.md
blob: 8e9771cbcd6adb506118b99a8af2d0c0068d4734 (plain)
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
# Frequently Asked Questions

## What is QMK?

[QMK](https://github.com/qmk), short for Quantum Mechanical Keyboard, is a group of people building tools for custom keyboards. We started with the [QMK firmware](https://github.com/qmk/qmk_firmware), a heavily modified fork of [TMK](https://github.com/tmk/tmk_keyboard).

## I don't know where to start!

If this is the case, then you should start with our [Newbs Guide](newbs.md). There is a lot of great info there, and that should cover everything you need to get started.

If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there.

## How can I flash the firmware I built?

First, head to the [Compiling/Flashing FAQ Page](faq_build.md). There is a good deal of info there, and you'll find a bunch of solutions to common issues there.

## What if I have an issue that isn't covered here?

Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same).

If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues/new)!

## What if I found a bug?

Then please open an [issue](https://github.com/qmk/qmk_firmware/issues/new), and if you know how to fix it, open up a Pull Request on GitHub with the fix.

## But `git` and `GitHub` are intimidating!

Don't worry, we have some pretty nice [Guidelines](newbs_git_best_practices.md) on how to start using `git` and GitHub to make things easier to develop.

Additionally, you can find additional `git` and GitHub related links [here](newbs_learn_more_resources.md).

## I have a Keyboard that I want to add support for

Awesome! Open up a Pull Request for it. We'll review the code, and merge it!

### What if I want to do brand it with `QMK`?

That's amazing! We would love to assist you with that!

In fact, we have a [whole page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK.

If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh).

## What Differences Are There Between QMK and TMK?

TMK was originally designed and implemented by [Jun Wako](https://github.com/tmk). QMK started as [Jack Humbert](https://github.com/jackhumbert)'s fork of TMK for the Planck. After a while Jack's fork had diverged quite a bit from TMK, and in 2015 Jack decided to rename his fork to QMK.

From a technical standpoint QMK builds upon TMK by adding several new features. Most notably QMK has expanded the number of available keycodes and uses these to implement advanced features like `S()`, `LCTL()`, and `MO()`. You can see a complete list of these keycodes in [Keycodes](keycodes.md).

From a project and community management standpoint TMK maintains all the officially supported keyboards by himself, with a bit of community support. Separate community maintained forks exist or can be created for other keyboards. Only a few keymaps are provided by default, so users typically don't share keymaps with each other. QMK encourages sharing of both keyboards and keymaps through a centrally managed repository, accepting all pull requests that follow the quality standards. These are mostly community maintained, but the QMK team also helps when necessary.

Both approaches have their merits and their drawbacks, and code flows freely between TMK and QMK when it makes sense.
*/ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  Atheros AR71xx SoC specific prom routines
 *
 *  Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
 *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
 *
 *  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/init.h>
#include <linux/io.h>
#include <linux/serial_reg.h>

#include <asm/bootinfo.h>
#include <asm/addrspace.h>
#include <asm/fw/myloader/myloader.h>

#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/platform.h>

struct board_rec {
	char		*name;
	unsigned long	mach_type;
};

static int ar71xx_prom_argc __initdata;
static char **ar71xx_prom_argv __initdata;
static char **ar71xx_prom_envp __initdata;

static struct board_rec boards[] __initdata = {
	{
		.name		= "411",
		.mach_type	= AR71XX_MACH_RB_411,
	}, {
		.name		= "433",
		.mach_type	= AR71XX_MACH_RB_433,
	}, {
		.name		= "450",
		.mach_type	= AR71XX_MACH_RB_450,
	}, {
		.name		= "493",
		.mach_type	= AR71XX_MACH_RB_493,
	}, {
		.name		= "AW-NR580",
		.mach_type	= AR71XX_MACH_AW_NR580,
	}, {
		.name		= "AP83",
		.mach_type	= AR71XX_MACH_AP83,
	}, {
		.name		= "TEW-632BRP",
		.mach_type	= AR71XX_MACH_TEW_632BRP,
	}, {
		.name		= "UBNT-RS",
		.mach_type	= AR71XX_MACH_UBNT_RS,
	}, {
		.name		= "UBNT-LSX",
		.mach_type	= AR71XX_MACH_UBNT_LSX,
	}
};

static __init char *ar71xx_prom_getargv(const char *name)
{
	int len = strlen(name);
	int i;

	if (!ar71xx_prom_argv)
		return NULL;

	for (i = 0; i < ar71xx_prom_argc; i++) {
		char *argv = ar71xx_prom_argv[i];

		if (!argv)
			continue;

		if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
			return argv + len + 1;
	}

	return NULL;
}

static __init char *ar71xx_prom_getenv(const char *envname)
{
	int len = strlen(envname);
	char **env;

	if (!ar71xx_prom_envp)
		return NULL;

	for (env = ar71xx_prom_envp; *env != NULL; env++)
		if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
			return *env + len + 1;

	return NULL;
}

static __init unsigned long find_board_byname(char *name)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(boards); i++)
		if (strcmp(name, boards[i].name) == 0)
			return boards[i].mach_type;

	return AR71XX_MACH_GENERIC;
}

static int ar71xx_prom_init_myloader(void)
{
	struct myloader_info *mylo;

	mylo = myloader_get_info();
	if (!mylo)
		return 0;

	switch (mylo->did) {
	case DEVID_COMPEX_WP543:
		ar71xx_mach_type = AR71XX_MACH_WP543;
		break;
	default:
		printk(KERN_WARNING "prom: unknown device id: %x\n",
				mylo->did);
	}
	ar71xx_set_mac_base(mylo->macs[0]);

	return 1;
}

static void ar71xx_prom_init_generic(void)
{
	char *p;

	ar71xx_prom_argc = fw_arg0;
	ar71xx_prom_argv = (char **)fw_arg1;
	ar71xx_prom_envp = (char **)fw_arg2;

	p = ar71xx_prom_getenv("board");
	if (!p)
		p = ar71xx_prom_getargv("board");
	if (p)
		ar71xx_mach_type = find_board_byname(p);

	p = ar71xx_prom_getenv("ethaddr");
	if (!p)
		p = ar71xx_prom_getargv("kmac");
	if (p)
		ar71xx_parse_mac_addr(p);
}

void __init prom_init(void)
{
	printk(KERN_DEBUG "prom: fw_arg0=%08x, fw_arg1=%08x, "
			"fw_arg2=%08x, fw_arg3=%08x\n",
			(unsigned int)fw_arg0, (unsigned int)fw_arg1,
			(unsigned int)fw_arg2, (unsigned int)fw_arg3);

	ar71xx_mach_type = AR71XX_MACH_GENERIC;

	if (ar71xx_prom_init_myloader())
		return;

	ar71xx_prom_init_generic();
}

void __init prom_free_prom_memory(void)
{
	/* We do not have to prom memory to free */
}

#define UART_READ(r) \
	__raw_readl((void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4 * (r)))

#define UART_WRITE(r, v) \
	__raw_writel((v), (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4*(r)))

void prom_putchar(unsigned char ch)
{
	while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
	UART_WRITE(UART_TX, ch);
	while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
}